Checking for validation errors in XMLHttpRequest
$.post(actionUrl, serializedForm, function(response) {
...
}
I need to check if the form validation is correct or not (I don't need exact validation errors). The validation is done with Spring and I would rather not interfere with the process because there are some annoying dependencies.
What would be the best approach? Is there a Spring error object in the response, or is it only available on the server side?
I would also like to know if there is any proper documentation about the answer on the jQuery site? How can I navigate or manipulate it?
a source to share
Depending on which actionUrl returned, the "response" could be an xml document, json object, text, etc ... depending on the content type specified by the server. It is up to your server side script to send information about any validation errors in the response so that they are available in the AJAX callback. The jQuery documentation contains several examples.
a source to share