Problem with ClientScript on Web Forms

Hello,

I am trying to do a very basic first Web Form with ERPNext v14.46.3

I have it everything as I wanted, except for one thing:

I wanted a checkbox field to be mandatory to fill (Privacity laws). As making the filed mandatory does not work, I am trying with a custom script. The problem is that nothing works, even the samples on documentation website does nothing.

For example if I do as in the documentation:

I don’t get any response when I load the page.

I don’t know what I am doing wrong.

Many thanks and kind regards from Spain,

Alb

@pagliaso Try this

frappe.web_form.after_load => {
    frappe.msgprint("your message");
});

In your code => is a code of =>, there is some issue with documentation sign conversion.

1 Like

Hello @Hardik_Gadesha ,

Many thanks for your reply.

It is working:

frappe.web_form.after_load =() =>{
frappe.msgprint(‘Please fill all values carefully’);
}

I was thinking that those characters were very strange, but was checking documentation with all my browsers and those letters were in there in all of them.

Many thanks and kind regards,

Alb

1 Like

@pagliaso Please mark this as solution

1 Like