I use the query form validate plugin (http://jqueryvalidation.org/documentation/) for validating some form fields via remote check, Below is my working demo code:
username: {
required: true,
minlength: 3,
maxlength: 25,
remote: "/dir/checkvalue.php"
}
The php script echoes just false
or true
as a string and the validation via the plugin is working fine. For some reasons I've to change the php's output to JSON, so it would be:
{"STATUS":false} or {"STATUS":true}
I don't know how to handle this JSON response in my js plugin conf array - any help appreciated, Thanks in advance :-)
There are some ways you can manage what is done with the remote option (see the documentation), such as passing an object to remote instead of your the URL. That object can be any of the settings described in the jQuery documentation.
Unfortunately, to my knowledge, there isn't any way to modify the returned data and have that passed back to jQuery Validate.