Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Client-side validation can be enabled on a per-form basis by specifying validate="true" in the form tag.

Code Block
html
html

<saf<s:form name="test" action="javascriptValidation" validate="true">
  ...
</safs:form>

If a name for the form is not given, the action mapping name will be used as the form name. Otherwise, a correct action and namespace attributes must be provided to the <saf:form> tag.

Code Block
html
html
titleReferencing "submitProfile" in the "/user" namespace

<saf<s:form namespace="/user" action="submitProfile" validate="true">
  ...
</safs:form>

Technically, the form's action attribute can refer to a "path" that includes the namespace and action as a URI. But, client-side validation requires that the action name and namespeact to be set separately.

Code Block
html
html
titleWon't work with client-side validation!

<saf<s:form action="/user/submitProfile.action" validate="true">
  ...
</safs:form>

All the usual validation configuration steps apply to client-side validation. 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.

...