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)
1 Like
@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).
For V13, you should do it like this ?new=1&[your parameters here]
. if you don’t include new=1 in the URL, the form will redirect and you will not be able to access your parameters.