Hi all, I'm using this script (http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/) to valdate my form etc, which also has a submit function.
Here's the code which sends the form to be processed:
jQuery("#adminForm_1").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: "/index.php?option=com_database&view=tripdetails&Itemid=12&client=1&task=save",
ajaxSubmitMessage: "Client Trip Details Saved",
inlineValidation: false,
success: false,
failure: function() {}
});
But I have this code which warns if you haven't filled out all the fields..
jQuery("#adminForm_1").submit(function () {
var empty = false;
jQuery(":input", "#adminForm_1").each(function() {
empty = (jQuery(this).val() == "") ? true : empty;
});
if(empty) {
var empty_ok = confirm('You have not filled out all of the fields, do you wish to continue?');
return empty_ok;
}
});
Currently when you click "Cancel" it still submits the form.. how can I change the code to make sure when you hit cancel it doesn't submit the form?