这是我的代码
的login.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="design.css">
<script type="text/javascript">
</script>
<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
<script src="jquery-1.11.0.min.js"></script>
<script src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="loginBouncy.js"></script>
<script src="modal.js"></script>
<script src="validate.js"></script>
<script src="jquery.validate.min"></script>
</head>
<div id='mask' class='close_modal'></div>
<div id="signup" class='modal_window'>
<img id="pane1" src="pane1.png"/>
<p id="label">SignUp</p>
<p id="label1">Personal Information</p>
<p id="label2">Account</p>
<p id="label3">Verification</p>
<hr id="hr1"/>
<form id="mainform" name="mainform" method="post" action="SignUp2.php">
<input type="text" name="data[]" id="fname" name="fname" placeholder="First Name"/>
<input type="text" name="data[]" id="lname" name="lname" placeholder="Last Name"/>
<input type="text" name="data[]" id="mname" name="mname" placeholder="M.I."/>
<input type="text" name="data[]" id="sadd" name="sadd" placeholder="Street"/>
<input type="text" name="data[]" id="tadd" name="tadd" placeholder="Town/City"/>
<input type="text" name="data[]" id="padd" name="padd" placeholder="Province/State"/>
<input type="text" name="data[]" id="user2" name="user2" placeholder="Your Username"/>
<input type="password" name="data[]" id="pass2" name="pass2" placeholder="Your Password">
<input id="captcha" name="captcha" type="text" name="captcha" placeholder="Insert Captcha">
<img id="imgcaptcha" src="captcha.php" /><br>
<input type="text" name="data[]" id="email" name="email" placeholder="Your Email"/>
<input type="button" id="btnSignUp" placeholder="" onclick="error2()"/>
</input>
</form>
</div>
</html>
validate.js
$(document).ready(function(){
$('#signup form').validate({
rules:{
name:{
required:true
},
email:{
required:true,
email:true
},
fname:{
required:true
},
lname:{
required:true
},
fname:{
required:true
},
mname:{
required:true
},
sadd:{
required:true
},
tadd:{
required:true
},
padd:{
required:true
},
pass2:{
required:true,
minlength:4
},
user2:{
required:true
},
captcha:
{
required:true
},
success:function(label){
label.text('OK!').addClass('valid');
}
}
});
});
答案 0 :(得分:3)
看起来你在脚本src中错过了.js
<script src="jquery.validate.min.js"></script>
答案 1 :(得分:1)
您在jQuery验证插件名称中缺少.js
,它应该是:
<script src="jquery.validate.min.js"></script>
<!------------------------------^^^ add .js here -->