Applying client-side validation to dsp:input
and dsp:select
tags enable the following behaviors based on the state of the validation in the input or select element:
Allows an inline indicator graphic to show or hide
Allows a client-side validation message to be added to the message bar when invalid contents are present (optional)
Causes the Dojo
SubmitButton
widget(s) (if present) to enable or disable
To enable client-side validation with a dsp:input
or dsp:select
tag, use the dsp:tagAttribute
tag:
<dsp:input id="dateOfBirth" type="text" value="01/01/1980"
size="30" converter="date" date="M/dd/yyyy"
bean="/atg/web/messaging/test/UserInfoFormHandler.dateOfBirth">
<dsp:tagAttribute name="dojoType" value="DateTextbox"/>
<dsp:tagAttribute name="lang" value="en-us"/>
<dsp:tagAttribute name="required" value="true"/>
<dsp:tagAttribute name="trim" value="true"/>
<dsp:tagAttribute name="invalidMessage" value="The date of birth is
invalid."/>
<dsp:tagAttribute name="missingMessage" value="The date of birth is
required."/>
<dsp:tagAttribute name="inlineIndicator" value="dateOfBirthAlert"/>
</dsp:input>
The dojoType
attribute specifies the type of client-side widget to use for the input element.
Note: The dsp:input
or equivalent tag must have an ID property defined for the SubmitButton
auto-enabling feature to work properly.
For detailed information on DSP tags, refer to the ATG Page Developer's Guide.