求解,點(diǎn)擊沒(méi)有提示,文件鏈接應(yīng)該沒(méi)有問(wèn)題
<!DOCTYPE html>
<html>
<head>
? ? <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
? ? <title></title>
? ? <style>
? ? p {
? ? ? ? color: red;
? ? }
? ? </style>
? ?<script src="vendor/jquery-1.10.0.js"></script>
<script src="vendor/jquery.validate-1.13.1.js"></script>
</head>
<body>
? <form id="demoForm">
? ? <fieldset>
? ? ? ? <legend>用戶登錄</legend>
? ? ? ? <p id="info"></p>
? ? ? ? <p>
? ? ? ? ? ? <label for="username">用戶名</label>
? ? ? ? ? ? <input type="text" id="username" name="username"/>
? ? ? ? </p>
? ? ? ? <p>
? ? ? ? ? ? <label for="password">密碼</label>
? ? ? ? ? ? <input type="password" id="password" name="password"/>
? ? ? ? </p>
? ? ? ? <p>
? ? ? ? ? ? <label for="confirm-password">確認(rèn)密碼</label>
? ? ? ? ? ? <input type="password" id="confirm-password" name="confirm-password"/>
? ? ? ? </p>
? ? ? ? <p>
? ? ? ? ? ? <input type="submit" value="登錄"/>
? ? ? ? </p>
? ? </fieldset>
</form>
<script>
$(document).ready(function(){
$('#demoForm').validate({
rules:{
username:{
required:true,
minlength:2,
maxlength:10
},
password:{
requierd:true,
minlength:2,
maxlength:16
}
}
});
});
</script>
</body>
</html>
2016-10-26
代碼沒(méi)有問(wèn)題,是否已在工程項(xiàng)目中加入vendor文件夾,vendor文件夾應(yīng)包含jquery-1.10.0.js,jquery.validate-1.13.1.js
這兩個(gè)js文件,以便加載jQuery validate 插件