<!DOCTYPE html><html><head><meta charset="GBK"><title>登錄</title><script type="text/javascript" src="/office/js/jquery-1.9.1.js"></script><script type="text/javascript" src="/office/js/jquery。validate.js"></script><script type="text/javascript">$(document).ready(function(){?$("#login").validate({??//自定義驗證規則????????? rules:{???????????? userName:{required:true},????????? password:{required:true}????????????? },????????? //自定義提示信息???????? /* messages:{???????????? userName:{required:"請輸入你的用戶名"},????????????? password:{required:"請輸入密碼"}???????????? }, */????????? //定義錯誤信息提示位置???????? errorPlacement:function(error,element){???????????? error.appendTo(".tip");??????????? // error.appendTo(element.parent());???????? }??});});</script></head><body>? <div style="width:400px;height:250px;margin:15% auto;background:#e8f4ff;">? <div style="winth:100%;height:15%;"></div><form id="login" name="login" method="post" action="login.php"><table style="width:100%;height:200px"><tr ><td align="right">用戶名:</td><td><input name="userName" type="text" id="userName" onmouseover="this.style.backgroundColor='#ffffff'" onMouseOut="this.style.backgroundColor='#e8f4ff'" size="15" /></td></tr><tr><td align="right">密碼:</td><td><input name="password" type="password" id="password"? onmouseover="this.style.backgroundColor='#ffffff'" onMouseOut="this.style.backgroundColor='#e8f4ff'" size="15" /></td></tr><tr><td></td><td><span class="tip"></span></td></tr><tr><td></td><td><input type="submit" value="登錄"? name="submit" /> <input type="reset" value="重置" name="reset" /></td></tr></table>? </form>? </div>? </body>這段代碼哪里錯了,為什么不進行驗證就提交了呢
1 回答

狗要綠豆冰
TA貢獻1條經驗 獲得超0個贊
<script type="text/javascript" src="/office/js/jquery。validate.js"></script>你確定你這個是這樣命名的?
- 1 回答
- 0 關注
- 1432 瀏覽
添加回答
舉報
0/150
提交
取消