How can I make custom script to handel data before submit?
You can use
frappe.ui.form.on("DocType", "on_submit", function(frm, cdt, cdn) {
// your code
})
1 Like
You can also use -
frappe.ui.form.on(âDoctypeâ, âbefore_submitâ, function(frm, cdt, cdn) {
// code
})
4 Likes
Just added alert within this code block, but not working
frappe.ui.form.on(âTest Childâ, âbefore_submitâ, function(frm, cdt, cdn) {
alert(âtestâ);
return false;
})
1 Like
@balaksara, It worked for me. Can you please check your Doctype name. Also i think, before_submit is only for Parent Doctype not for Child table.
Thanks, Priya
Thanks for your reply. Sorry! It was my bad. It worked for me after enabling isSubmittable.
Thaks, Saravanan