Try ERPNext Buy Support Partners Foundation

Web form client script not working

Hi in the following client scripts for web forms

The line
frappe.web_form.set_df_property(‘rate’, ‘hidden’, 1); or frappe.web_form.set_df_property(‘rate’, ‘read_only’, 1); does not work.

I want to make a field in web form read only once the value have been entered.
I have tried something like this:

// make fields read_only once entered on web form client script
frappe.web_form.on(‘currency’, (field, value) => {
if (value !== “”) {
frappe.msgprint(‘Once set these values cannot be changed’);
frappe.web_form.set_df_property(‘currency’, ‘read_only’, 1);
}
});

The message is printed but the field is not set to read_only.
Please help if anyone has any idea to this bug

Has this been resolved? I also have the same issue.

Looks, it haven’t been solved, I’m using v12, and issue persist

Use frappe.web_form.set_property (‘xxx’,‘hidden’, 1);
Worked for me