jQuery Validation script doesn't work, at all -
so i'm creating contact form, , i'm trying create validation script, , doesn't work @ all, doesn't show errors. goes default validation.
i have looked in resources, , js file loaded on page doesn't work...?
jquery.validator.addmethod("answercheck", function(e, t) { return this.optional(t) || /^\bcat\b$/.test(e) }, "please type correct answer"), $(function() { $("#contact").validate({ rules: { name: { required: !0, minlength: 2 }, email: { required: !0, email: !0 }, message: { required: !0 }, answer: { required: !0, answercheck: !0 } }, messages: { name: { required: "please enter name", minlength: "your name must consist of @ least 2 characters" }, email: { required: "please enter email" }, message: { required: "please enter message", minlength: "please enter longer message" }, answer: { required: "incorrect" } }, submithandler: function(form) { $(form).ajaxsubmit({ type:"post", data: $(form).serialize(), url:"process.php", success: function() { $('#contact :input').attr('disabled', 'disabled'); $('#contact').fadeto( "slow", 0.15, function() { $(this).find(':input').attr('disabled', 'disabled'); $(this).find('label').css('cursor','default'); $('#success').fadein(); }); }, error: function() { $('#contact').fadeto( "slow", 0.15, function() { $('#error').fadein(); }); } }); } }); });
if check console you'll see error:
uncaught typeerror: $(...).sticky not function
that error block other scripts execution , validation too.
Comments
Post a Comment