Well, this is what I ended up having to do to fix the problem. First I took what Andrew said and found more out there to support what he was saying. The most helpful was this post:
Problem with jQuery validate plugin (remote validation)
This post basically added these lines to my existing code:
dataFilter: function (data) {
var x = (JSON.parse(data)).d;
return JSON.stringify(x);
}
The problem was still there though. I started thinking about what could be wrong and started to wonder about my web service and how it was returning other than the .d response. I had used different modifications of this web service for some time now, but for some reason this one was not working. After looking a bit more at it I thought about the fact that it was returning a list of values since that is what I needed everywhere else. I was only returning one item in that list, but I was wondering what would happen if I returned just that item instead of the list. My web service now returned this:
{"d":"true"}
This still did not work with my original code, but now I was fairly certain it was because it was returning as d. The dataFilter I found at the other site was still not allowing it to work so I modified the dataFilter a little bit to return just plain text like this:
dataFilter: function (data) {
var x = (JSON.parse(data)).d;
return x;
}
Finally I had a solution that was working. During this process I ran into issues with getting the validation to trigger again after it failed, or supposedly returned true even though it was in error. There is a lot more information out there about this and since that wasn't the original question I won't go into all of that. One helpful post was:
jquery validation - remote method won't trigger after valid However, just because they are so related I used this code to reset the validation allowing the validation to be triggered again even with a recent true valid call.
$("[id$=txtOther]").removeData("previousValue");
I am still using this code along with the following code to trigger the validation on demand:
var resetValid = $("[id$=txtOther]").valid();
This is my final code for the remote validation:
$("[id$=txtOther]").rules("add", {
remote: function () {
return {
type: "POST",
url: $("[id$=hBaseURL]").val() + "Webservice/Validation.asmx/ValidateUser",
data: JSON.stringify({ FullName: $("[id$=txtOther]").val(), UserID: $("[id$=txtOtherID]").val() }),
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
dataFilter: function (data) {
var x = (JSON.parse(data)).d;
return x;
}
};
},
messages: {
remote: "Additional reviewers must be selected from available options"
}
});