Forum Moderators: open
jQuery(document).ready(function() {
// validate signup form on keyup and submit
var validator = $("#validationForm").validate({
rules: {
firstname: "required", //Set the first name field to be a required Form
email: {
required: true, //Set the e-mail field to be a required Form
email: true, //Set the e-mail field to be validated as an e-mail address
},
},
messages: {
firstname: "Enter your firstname",
email: {
required: "Please enter a valid email address",
minlength: "Please enter a valid email address",
}
},
});
});
// specifying a submitHandler this will submit the form after we have validated ok
submitHandler: function() {
return false; // avoid the actual submit of the form.
}
How to set correct handler and avoid any submitted values if form is not validated. User can refresh page and it will be sent form. This is an issue.