How can I show a confirm message before submit form data and if the result of confirm is false to cancel the submit action?
The following code is not working while the $.messager.confirm() working asynchronous.
onSubmit: function(param){ //Fires before submit, return false to prevent submit action.
if($(this).form('validate') == false) { //validate form data
$.messager.alert(infoTitleInvalidInput, infoTitleInvalidMsg, "error");
return false;
};
$.messager.confirm(infoTitleConfirm, confirmEdit, function(r){
if (r) { return true;}
});
return false;
},