[jQuery] Help with cross-site form validation?
I need to do validation on an email address via AJAX, and it has to
happen cross-domain. I can get this to work fine using just jQuery's
$.ajax method, but not when I try to turn it into a validator plugin
method. As a validator method, it does the XHR call fine, and I see
the results I expect in the console, but it seems to flag everything
as invalid.
The method is here: http://pastie.org/447779
I think I'm just bad at writing custom validation methods, b/c as I
said up top this works fine as a regular jQuery function.
Notice that I'm using the success callback to cheat a little -- my
server-side code throws back a status code of 200 and a piece of JSON
containing a string of either "success" or "failure", and then the
valid/invalid logic is in the success callback. I had to do this b/c
the success callback is apparently the only one you get when doing a
JSONP dataType.
I'd love to use the great features inherent in the validator plugin
for this if I could. Does anyone know how this can be done?
many thanks!
-TR