jQuery的Validate插件
2021-07-14 05:05
标签:required target function span ref 异步 www logs ddr http://www.runoob.com/jquery/jquery-plugin-validate.html 项目中的:: jQuery的Validate插件 标签:required target function span ref 异步 www logs ddr 原文地址:http://www.cnblogs.com/yangjian-java/p/7076564.html $(function () {
$(‘#createDepartment‘).validator({// jsvalidator框架
rules: {
remote: function (element) {//远程异步加载
return $.ajax({
url: /*[[@{/portal/human/department/valid-department-name.act}]]*/ "#",
type: ‘post‘,
data: {
"departmentname": function () {
return $(‘#name‘).val();
}
},
dataType: ‘json‘
});
}
},
fields: {
"superior.id": "required;superior.id;",
"name": "required;name;remote;",
"phone": "required;phone;",
"address": "required;address;",
"type": "required;type;"
}
});
});
上一篇:html学习3 首字母缩写标签