Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

Pass value to Web Form

I have to pass value to the hidden field in web form, is there any way to pass value to the web forms?

Hi @Rutvik_Panchal,

within the Client Script part of your WebForm, you can get URL Parameters like the following, eg.

const urlParams = new URLSearchParams(window.location.search);
const my_param = urlParams.get('your_get_param'); 

To set a value

frappe.web_form.set_value('your_field', my_param)

@Patrick.St Yes it worked. Thanks, but my form is redirected to a new url with ?new=1 as parameter any solution?

@Rutvik_Panchal, that is standard behaviour - as based on this parameter it will be decided, if the user will get the “new form” view or a list view with already sent forms.

Keep in mind, that WebForms are going to be refactored (see v13 release notes).