Hi Ahmad,
Greetings from Syncfusion support.
We checked the reported requirement. We have prepared the custom sample based on the requirement. Cancel the form submit in the button submit event using preventDefault(). If you click the save button in the dialog call the submit method for formelement. Otherwise hide the dialog. Refer to the code below,
|
function onFormSubmit(e) {
e.preventDefault();
var confirm = document.getElementById("confirmationDialog").ej2_instances[0];
confirm.show();
}
function dlgSaveClick() {
var dialogObj = document.getElementById("confirmationDialog").ej2_instances[0];
var formStatus = formObj.validate();
document.getElementById('form1').submit();
dialogObj.hide();
}
function dlgCancelClick(e) {
var dialogObj = document.getElementById("confirmationDialog").ej2_instances[0];
dialogObj.hide();
} |
Regards,
Sevvandhi N