2012년 3월 13일 화요일

JQuery Validate add Method


jQuery.validator.addMethod(
“notEqualTo”,
function (value, element, param) {
return this.optional(element) || value != param.val();
},
“Please specify a different value”
);
and:

rules: {
oneCity: {
notEqualTo: $(‘#anotherCityId)’)
},
anotherCity: {
notEqualTo: $(‘#oneCityId’)
}
},