請問一下,我的這個remote遠程校驗怎么不能用?我在我的remote.json里面是寫的true,為什么鼠標移開不能提交,沒有提交數據?<!DOCTYPE html><html><head><meta charset="UTF-8"><title>jQuery Validation 插件</title></head><style>? body{font-size:36px; line-height:1.6}p{margin:10px 0;}label{display:inline-block; min-width:140px;}label.error{margin-left:10px;color:red;}input,button{line-height:35px; border:1px solid #999; min-width:180px; font-size:36px;}input.error{border:1px solid red;}input[type=submit],button{margin-top:20px; font-size:36px; padding:10px 0;}</style><body><form action="" id="demoForm"><fieldset><legend>用戶登錄</legend><p><label for="">用戶名</label><input type="text" id="username" name="username"></p><p><label for="">密碼</label><input type="password" id="password" name="password"></p><p><input type="submit" value="登錄"></p></fieldset></form><script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script><script src="jquery-validation-1.15.0/dist/jquery.validate.js"></script><script>$(document).ready(function() {$("#demoForm").validate({debug:true,rules:{username:{required:true,minlength:2,maxlength:10,remote:"remote.json",},password:{required:true,minlength:2,maxlength:16,},},messages:{username:{required:"必須填寫用戶名",minlength:"用戶名最小為2位",maxlength:"用戶名最大為10位",},password:{required:"必須填寫密碼",minlength:"密碼最小為2位",maxlength:"密碼最大為16位",},}});});</script></body></html>
- 1 回答
- 0 關注
- 1416 瀏覽
添加回答
舉報
0/150
提交
取消