Basic JavaScript Trigger functions in fields like onclick

Hi,

I’ve been working with angular and new to frappe.

I saw methods like

frappe.ui.form.on(“Doctype”, “field”, function(frm,cdt,cdn) {
});

But it i couldn’t validate if the field is left empty (must need to validate in client side)

How can i use triggers like ng-click, onclick, ng-blur etc.

@ninjas005, it dont exists in the box!

The document have the validate event, for validation purpose!

1 Like

cur_frm.fields_dict.fieldname.$input.on("click", function() {});

This is not a recommended way to do things. It would be good if you can share what you want to achieve so that we can recommend a better solution.

1 Like

Hi @anand

the customers might be using tab key to fill the form.

I don’t want them to leave a specific field empty.