I'm struggling with a form and JavaScript code interaction. In my code, when the validateDialogForm()
function is called, a jQuery dialog appears under certain conditions. The issue is that the dialog only shows for a few seconds before the form continues to submit. I want the form to pause after the dialog appears and only submit when the user clicks the save
button. I've tried using return false;
at the end of the validateDialogForm()
function to prevent the form from submitting immediately, but then the form does not submit even when the save button on the dialog is clicked. What am I missing in my code? As it stands now, the form submits regardless of the presence of the jQuery dialog.
$('#checklist_dialog').hide();
function validateDialogForm() {
// JavaScript code here...
}