首页 > 代码库 > validator插件的调用方法
validator插件的调用方法
$(‘#form_info‘).validator({
rules : {
username : [/^\w{5,12}$/, "Please enter 5-12 digits, letters, underscores"],
email : [/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/i, "Please enter a valid email address."],
password : [/^[a-zA-Z]\w{5,17}$/, "The password is start with a letter <br />composed of 6-16 digits or letters"]
},
fields : {
username : ‘required; username;remote[__APP__/User/checkName];‘,
email : ‘required; email;remote[__APP__/User/checkEmail];‘,
password : ‘required; password;‘,
repassword : ‘required; match(password);‘
}
});
validator插件的调用方法