我正在尝试编写一个规则来使用远程查找验证多个动态添加的输入。我不知道如何获取远程规则定义中正在验证的字段。例如:
$.validator.addClassRules({
refDataAcInput: {
remote: {
url: "/json/refDataLookup.html",
type: "get",
data: {
groupName: function(a,b,c){
//$(this).data("groupName");
//THE ABOVE DOESN'T WORK, HERE I WANT TO GET THE VALUE OF THE FIELD BEING VALIDATED
},
term: function(a,b,c){
//$(this).val();
//THE ABOVE DOESN'T WORK, HERE I WANT TO GET THE VALUE OF THE FIELD BEING VALIDATED
},
exactMatch: "true"
},
dataFilter: function(data, type) {
return data;
},
success: function(data, textStatus, jqXHR) {
alert(textStatus);
}
}
}
});
我怎样才能做到这一点?