...
Code Block | ||||
---|---|---|---|---|
| ||||
<ww:form name="'test'" action="'javascriptValidation'" validate="true"> ... </ww:form> |
Of course, all the standard validation configuration steps still apply. Client-side validation uses the same validation rules as server-side validation. That said, there are some caveats to using client-side validation:
...
Make sure you provide the correct "action" and "namespace" attributes to the <ww:form> tag
...
. For example, if you have an Action named "submitProfile" in the "/user" namespace, you must use
...
Code Block | ||||
---|---|---|---|---|
| ||||
<ww:form action="'/user/submitProfile.action'" validate="true"> ... </ww:form> |
Of course, all the standard validation configuration steps still apply. Client-side validation uses the same validation rules as server-side validation. If server-side validation doesn't work, then client-side validation won't work either.
Note that the "required" attribute on many WebWork UI tags has nothing to do with client-side validation.
Upgrade Alert: This feature was introduced in WebWork 2.1. If upgrading from a previous version, make sure you are using the correct validators in validators.xml. You must be using the com.opensymphony.webwork.validators.JavaScriptRequired*Validator version of the standard XWork validators.
...