The validate plugin on error also adds errorClass to input field. How to avoid this?
var validator = $("#contacts_form").validate({
submitHandler: function(form) {
form.submit(); //Must be called here,
},
errorElement: "p",
errorClass : 'form-item-validation',
rules: {
name: "required",
website: {
required: true,
minlength: 5
},
email: {
required: true,
email: true
},
onchange: true
},
messages: {
name: "Please enter your firstname",
email: {
email: "Please enter a valid email address"
}
}
});
labelelements. Therefore if you need them to be different, that's not possible. I'm not sure why you'd need to avoid the class on the form elements anyway. Just amend the CSS rules if it's a UI issues'form-item-validation' has styles and thats breaks allin that case just change the CSS as you need.onchangeis not one of your field names? Please note that only field names followed by their methods go inside of therulesobject, so basically,onchange: truemakes absolutely no sense inside there. Secondly,onchangeis not even an option for this plugin: jqueryvalidation.org/?s=onchange