I am getting an error in my jQuery code. This is the error:
TypeError: jQuery.validator is undefined additional-methods.js:20 TypeError: $(...).validate is not a function index.php:115
This is my 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>
I think I have made some mistakes in the code. Can someone please solve this?