I have a save button (enter button) in which I wrote javascript code to save form data in a database. My jQuery.validate function does not run until the form is saved. How can I manually execute my jQuery.validate function before saving. That's what I'm doing.
<input type="button" class="saveSubmit" name="action" value="Save" />
$(".saveSubmit").click(function() {
if (save() == true) {
alert("Email has been saved.");
} else {
alert("Error saving email.");
};
return false;
});
$("#emailForm").validate({
});
source
share