Operation Manual
431
USING DREAMWEAVER
Building Spry pages visually
Last updated 3/28/2012
Whenever a Validation Checkbox 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 made no selections, Spry applies a class to the widget that causes it to display the error message, “Please
make a selection.” The rules that control the style and display states of error messages reside in the CSS file that
accompanies the widget, SpryValidationCheckbox.css.
The default HTML for the Validation Checkbox widget, usually inside of a form, comprises a container <span> tag
that surrounds the <input type="checkbox"> tag of the check box. The HTML for the Validation Checkbox 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 Checkbox widget works, including a full anatomy of the
Validation Checkbox widget’s code, see
www.adobe.com/go/learn_dw_sprycheckbox.
Insert and edit the Validation Checkbox widget
Insert the Validation Checkbox widget
1 Select Insert > Spry > Spry Validation Checkbox.
2 Complete the Input Tag Accessibility Attributes dialog box and click OK.
Note: You can also insert a Validation Checkbox widget by using the Spry category in the Insert panel.
More Help topics
“Create accessible HTML forms” on page 638
Specify when validation occurs
You can set the point at which validation occurs—when the user clicks outside the widget, as the user makes selections,
or when the user tries to submit the form.
1 Select a Validation Checkbox widget in the Document window.
2 In the Property inspector (Window > Properties), select the option that indicates when you want validation to
occur. You can select all of the options or Submit only.
Blur Validates whenever the user clicks outside the check box.
Change Validates as the user makes selections.
Submit Validates when the user tries to submit the form. The submit option is selected by default, and cannot be
deselected.
Specify a minimum and maximum selection range
By default, a Validation Checkbox widget is set to required by default. If you insert a number of check boxes on your
page, however, you can specify a minimum and maximum selection range. For example, if you have six check boxes
within the <span> tag for a single Validation Checkbox widget, and you want to make sure that the user selects at least
three check boxes, you can set such a preference for the entire widget.
1 Select a Validation Checkbox widget in the Document window.
2 In the Property inspector (Window > Properties), select the Enforce Range option.
3 Enter a minimum or maximum number (or both) of check boxes that you want the user to select.