javascript - Jquery validation plugin - TypeError: $(...).validate is not a function -
my script throw errors:
typeerror: jquery.validator undefined additional-methods.js:20 typeerror: $(...).validate not function index.php:115
probably, have mistake in jquery code.
<head> <script type="text/javascript" src="js/jquery-1.10.2.js"></script> <script type="text/javascript" src="js/jquery.form.js"></script> <script src="http://jquery.bassistance.de/validate/additional-methods.js"></script> </head> <body> <form id="registerform" method="post" action="logrej.php"> <input name="login" type="text"/> <input name="nick" type="text"/> <input type="password" id="passw" name="password"/> <input type="password" name="retype" /> <input type="submit" value="zarejestruj!" /> </form> <script> $("#registerform").validate({ rules: { login: { required:true, rangelenght: [4,20], remote:"look.php" }, nick : { required:true, rangelenght:[4,20], remote:"look.php" }, password: { required:true, rangelenght:[4.20] }, retype: { required:true, equalto:"#passw" } }, messages:{ login:{ required:"to pole jest wymagane!" } } }) </script>
you're not loading validation plugin. need:
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
put before line loads additional methods.
also, should additional methods cdn well, rather jquery.bassistance.de.
other errors:
[4.20]
should
[4,20]
and
rangelenght:
should be:
rangelength:
Comments
Post a Comment