Cannot read property 'df' of undefined

just started to write some basic client scripts and i cant seem to get the event handler to work. What is going wrong

frappe.web_form.on(“Contact Us”, { onload : function(frm) {

}
});

If you’re trying to add js to a doctype, you need to use this syntax:

frappe.ui.form.on('Contact Us', {
    refresh: function(frm, cdt, cdn){
       //code here
    }
});

I must say that if it’s for a doctype (not a webview/webform), depending on what you’re doing, you should pass by a hook instead.

1 Like

I realised what i did. i got the stuff for a webform and a normal doc type confused