posted 19 years ago
The validators (both pre-defined and user-defined) perform server-side validation. They may or may not provide client-side validation. If you look at the definitions of the pre-defined validators in validation-rules.xml you can identify if a validator provides client-side javascript validation or not.
STATIC
The javascript methods, present within the <javascript> element or in .js files, form the static content generated by <html:javascript>.
DYNAMIC
1. The <html:javascript> tag generates javascript objects for each pluggable validator, that are used by the static javascript method of that validator. These store the information about the fields and their validation as defined in the validation.xml. For example:
2. In addition it also generates the main javascript validation method which initiates the entire client-side validation.
You can turn each attribute's generation of JavaScript on and off by putting in true or false (they default to true).
Normally, dynamicJavascript is set to true so that is gets generated on the page and staticJavascript is set to false. The static javascript can be put in .js files to take advantage of browser caching.
I hope this makes sense. Have a look at the code generated by the <html:javascript>.
Sheldon Fernandes
[ October 10, 2004: Message edited by: Sheldon Fernandes ]