First I will say that as far as I know you have to nest the validation methods under a certain attribute - you can't just put them on global scope. This would make your code look like this:
$('#form').validate({
rules:{
attribute1: {
remote_check_1: true,
remote_check_2: true
}
},
messages:{
attribute1:{
remote_check_1: 'Error1',
remote_check_2: 'Error2'
}
}
});
I don't know if you can put the both under the rules object and raise different error messages for them.
What you can do is create two custom validation functions, each with different name. The result would look like:
$.validator.addMethod(
"remote_check_1",
function(value, element) {
res = $.ajax({url: 'url1.php', data: { attribute1: value }, dataType: 'json'});
return res;
}
);
$.validator.addMethod(
"remote_check_2",
function(value, element) {
res = $.ajax({url: 'url2.php', data: { attribute1: value }, dataType: 'json'});
return res;
}
);