Why my script can't reach this part of my app

ok my script is working fine but I must click Edit in full page in order to enable it to work properly.

here you are:

frappe.ui.form.on(“Contacto”, “validate”, function(frm) {

var value = frappe.model.get_value(‘Contacto’, frm.doc.name, ‘full_name’);
var pattern = /^[A-Za-z\s]+$/;
var result = pattern.test(value);

if (!pattern.test(value)) {

frappe.msgprint("Formato invalido para campo Contacto no incluye								    								    numeros");
    validated = false;

}

});

the thing is I want my Script to take effect on the Full Name field when I click on the save button and not necessarily clicking on edit in full page to start working.

Try with:

var value = frm.doc.full_name;

2 Likes