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"
}
1 Like