validate remote remote.json

http://img.mukewang.com/56907c19000113af08350235.jpg

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title></title>

<script type="text/javascript" src="js/jquery-1.10.0.js"></script>

<script type="text/javascript" src="js/jquery.validate-1.13.1.js"></script>

</head>

<body>

<div>

<form><input type="text" name="username">

<input type="submit" value="提交">

</form></div>

<script>

$(document).ready(function() {

$(".form").eq(0).validate({

debug:true,

rules:{

username:{

required:true,

minlength:6,

maxlength:15,

remote:"remote.json"

}

    },

    messages:{

    username:{

     required:"用户名必须填写",

     minlength:"最小长度为6",

     maxlength:"最大长度为15",

    }

    }

})

})

</script>

</body>

</html>


qq_墨明棋妙_2
浏览 1386回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JQuery