The remote method of validator using one field works fine.
I have a LastName field in the remote rule, where I am passing FirstName and a unique identifier and the LastName for validation.
I add an invalid data on the form I get error message correctly.
I change the fields values of LastName and FirstName to valid data The parameters passed to the remote url donot change, and error is displayed even for correct data.
I can't get pass this. the code goes like this:
LastName:{
required:true,
remote:{
url: '/CheckUniqueContact?OpenAgent',
async: false,
cache: false,
data:{
UniqueKey:$("input[name='UniqueKey']").val(),
FirstName:$('#FirstName').val(),
LastName:$('#LastName').val(),
}
}
}
the message section has
LastName:{
required: "This Firstname & LastName combination already exists please choose another name combination.",
remote: "This Firstname & LastName combination already exists please choose another name combination."
}
What mistake I may be making. Also if adding an ajax call is made for Validator.addMethod then how can i use this method with a group rule?
Thanks in advance