Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > Validation > Client Side Validation > Pure JavaScript Client Side Validation > AJAX Client Side Validation |

Apache Struts 2 Documentation
AJAX Client Side Validation
Edit Page Browse Space Add Page Add News
Added by roughley, last edited by Ted Husted on Jan 08, 2007 (view change)

| This validation mode only works with the ajax theme

AJAX-based client side validation improves upon Pure JavaScript Client Side Validation by using a combination of JavaScript, DOM manipulation, and remote server communication via DWR. Unlike the pure client side implementation, AJAX-based validation communicates with the server. This means all your validation rules that worked when submitting a form will still work within the browser.

The validation occurs on each onblur event for each form element. As each user types in some values and moves to the next form element, the value (and all other values previously entered) will be sent to the server for validation. The entire validation stack is run, including visitor validators and your action's validate() method.

If there is an error, like the pure implementation, the HTML and DOM will be updated immediately.

For an example of this, see AJAX Validation.

Children Show Children Hide Children
AJAX Validation (Apache Struts 2 Documentation)