| < Day Day Up > |
|
The <html:javascript /> tag is used to insert JavaScript validation methods based on the Commons Validator Plugin, which we discussed in Chapter 12, "Working with the Validator." The JavaScript methods used for validation are retrieved from the Validator definition file using the formName as the index. The <html:javascript /> tag has no body and supports eight attributes, described in Table 16.12.
Attribute | Description |
---|---|
cdata | If true and the xhtml attribute of the <html:html /> tag is also true, then the generated JavaScript will be placed within CDATA elements (preventing XML parsing). The default is true. (optional) |
dynamicJavascript | Indicates if dynamic JavaScript should be enabled. The default value is true. (optional) |
formName | Represents the identifier that is used to retrieve the appropriate Validator rules. (optional) |
htmlComment | If true, then the defined JavaScript elements are enclosed within HTML comment markers. (optional) |
method | Allows a user of the tag to override the default method name. If not indicated, the default method name is validate. (optional) |
page | Represents the current page number of a multipart form. This attribute is valid only when the formName attribute is used. (optional) |
src | Names an external JavaScript resource to include in the hosting page. This attribute is valid only when the formName attribute is used. (optional) |
staticJavascript | Indicates whether static JavaScript should be rendered in this page. The default value is true. (optional) |
| < Day Day Up > |
|