How can I allow the submission to go through after user have verified successfully?

Hi Everyone,
I’m trying to request the user to verify their password only then they can submit the document.

This is the code i’m using:

before_submit: function(frm) {
frappe.validated = false;
frappe.verify_password(function() {
frappe.validated = true;
});
}

Problem: The form doesn’t get submitted even if the user have verified their password.
Question: How can I continue the submission after verifying the user’s password?

Surprised I couldn’t get any help on this, thankfully after much digging i found the solution! Here it is:

before_submit: function(frm) {
		freeze:true 
		frappe.validated = false
		frappe.verify_password(function() {			
			cur_frm.save("Submit");					
		});	
	},
	
	on_submit : function(frm) {
		frappe.validated = true; 
	}

Please close this now…

1 Like