Operation Manual

420
USING DREAMWEAVER
Building Spry pages visually
Last updated 3/28/2012
Required state The widget state when the user has failed to enter required text in the text field.
Minimum Number Of Characters state The widget state when the user has entered fewer than the minimum number
of characters required in the text field.
Maximum Number Of Characters state The widget state when the user has entered greater than the maximum number
of characters allowed in the text field.
Minimum Value state The widget state when the user has entered a value that is less than the value required by the text
field. (Applies to integer, real, and data type validations.)
Maximum Value state The widget state when the user has entered a value that is greater than the maximum value
allowed by the text field. (Applies to integer, real, and data type validations.)
Whenever a Validation Text Field widget enters one of these states through user interaction, the Spry framework logic
applies a specific CSS class to the HTML container for the widget at run time. For example, if a user tries to submit a
form, but has entered no text in a required text field, Spry applies a class to the widget that causes it to display the error
message, “A value is required”. The rules that control the style and display states of error messages exist in the CSS file
that accompanies the widget, SpryValidationTextField.css.
The default HTML for the Validation Text Field widget, usually inside of a form, comprises a container <span> tag
that surrounds the <input> tag of the text field. The HTML for the Validation Text Field widget also includes script
tags in the head of the document and after the widget’s HTML markup.
For a more comprehensive explanation of how the Validation Text Field widget works, including a full anatomy of the
Validation Text Field widget’s code, see
www.adobe.com/go/learn_dw_sprytextfield.
Insert and edit the Validation Text Field widget
Insert the Validation Text Field widget
1 Select Insert > Spry > Spry Validation Text Field.
2 Complete the Input Tag Accessibility Attributes dialog box and click OK.
Note: You can also insert a Validation Text Field widget by using the Spry category in the Insert panel.
More Help topics
Create accessible HTML forms” on page 638
Specify a validation type and format
You can specify different validation types for the Validation Text Field widget. For example, you can specify a credit
card validation type if the text field will receive credit card numbers.
1 Select a Validation Text Field widget in the Document window.
2 In the Property inspector (Window > Properties), select a validation type from the Type menu.
3 If applicable, select a format from the Format pop-up menu.
Most validation types cause the text field to expect a standard format. For example, if you apply the integer validation
type to a text field, the widget won’t validate unless the user has entered numbers in the text field. Some validation
types, however, let you choose the kind of format your text field will accept. The following table lists validation types
and formats that are available through the Property inspector: