Embed ERPNext Webform or use Iframes

Was looking for a way to embed or use Webforms in iframe from ERpnext on another website. Any one has worked out how to achieve this.

@Harsh_Vardhan

I didn’t not embed, but usually I recreate my own form on any website and I use the webform API to send the data back to ERPNext!

Your ERPNext server need to have CORS enabled and allowing connections from the other websites

On your form you will need two inputs with type hidden

<input type="hidden" name="webform_name" value="your webform name in ERPNEXT" />
<input type="hidden" name="doctype" value="The DocType your webform is tight in ERPNext" />

And in your external website you need to have an small JavaScript to post at

https://your-server.com/API/method/frappe.website.doctype.web_form.web_form.accept

On the body you need to pass

{
   "data": { your form fields ... },
   "web_form": "your web form name in ERPNEXT"
}
2 Likes

Hi @max_morais_dmm Is your solution still working? I am trying to replicate it but failing. I am using ERPNext V14

@Shiva_Shandilya1 I saw that on the develop branch, you can now, copy the iframe to embed webforms!

Hi @Shiva_Shandilya1 @max_morais_dmm:

Check this …

It was merged for develop and version-15