tags:

views:

57

answers:

1
$.post(actionUrl, serializedForm, function(response) {
 ...
}

I need to check whether validation of form succeeded, or not (I don't need to know the exact validation errors). The validation is done by Spring, and I wouldn't like to interfere the process, because there's some annoying dependencies.

What would be the best approach? Is there a Spring error object in response, or is it accessible only in server side?

I would also like to know if there's is any proper documentation about response in jQuery site? How can I traverse or manipulate it?

A: 

According to what actionUrl returned, "response" can be an xml document, a json object, text, etc... depending on the Content-Type set 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. JQuery's documentation has some examples.

Darin Dimitrov