I am having an issue with the jquery validation plugin when checking an email address remote.
The remote function is returning a JSON string like:
"{ "isValid": "true", "email": "email@email.com" }"
I know that the default setting in jquery validation should only consist of a json-string returning true or false. But I need to return the email that is checked.
Is it possible to have the remote validation function to check the json-property “isValid”?
Thanks,
James Ford
You can easily extend the validator plugin. All you have to do is use
$.validator.addMethod(), add a method that makes the remote call, gets the JSON string you have shown, performs the tasks for which you need the email address returned and return true or false at the end back to the validation flow.This might help: http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage