I am using remote validation on a textbox and I am returning an object from the validation service with properties which should be used to populate other elements on the form. I have the following code in the rules options for my form:
<%= Job.UniqueID %>:{
remote:
{
url: "ComboBox.svc/ValidateJob",
dataType: "json",
data: {
criteria: function()
{
return $("#<%= Job.ClientID %>").val();
}
},
success: function(data,textStatus,XMLHttpRequest){
// Load elements from data parameter
return false;
}
}
}
My success callback is called, but the validator callback in jquery.validate.js is not, so I do not see the message when validation fails. If I remove the success callback above I do see the error message.
I'm suspecting that this is not the correct place to but I'm not sure where else I should attempt this, perhaps I should use validator.addMethod?
Any suggestions would be apperciated.
Shane Holder