JQuery Validate + Form Plugin integration Confusion
Hello all!
I cannot figure out for the life of me why this code wont work. Its a simple 3 field form with validation. After submission the form should reset and thank the user for their email. Ive looked over all the docs and even watched a few Youtube vids, but I can figure out my mistake.
- (document).ready(function(){
$("#contact_form").validate({
rules:{
namefield:{
required: true,
minlength: 10
},
emailaddress:{
required:true,
minlength: 12,
email: true
},
textmessage:{
required:true,
minlength: 12,
maxlength: 2500
}
},
errorElement: "div",
wrapper: "div class=\"validatemessage\"",
submitHandler:function(form){
$(form).ajaxForm(function() {
alert("Thank you for your comment!");
form.reset();
});
}
});
});