beautypg.com

Specify when validation occurs, Specify a minimum and maximum selection range, Display widget states in design view – Adobe Dreamweaver CS3 User Manual

Page 484

background image

DREAMWEAVER CS3

User Guide

477

Specify when validation occurs

You can set the point at which validation occurs—when the user clicks outside the widget, as the user makes selec-
tions, 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 none of them.

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.

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 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.

Display widget states in Design view

1

Select a Validation Checkbox widget in the Document window.

2

In the Property inspector (Window > Properties), select the state you want to see from the Display state pop-up

menu. For example, select Initial to see the widget in its initial state.

Customize Validation Checkbox widget error messages

By default, error messages for the Validation Checkbox widget appear in red with a 1-pixel border surrounding the
text. You can alter the CSS for the Validation Checkbox widget so that you can create a widget that is styled to your
liking. For a more advanced list of styling tasks, see

www.adobe.com/go/learn_dw_sprycheckbox_custom

.

1

Open the SpryValidationCheckbox.css file.

Dreamweaver saves the SpryValidationCheckbox.css file in the SpryAssets folder of your site whenever you create a
Spry Validation Checkbox widget. It’s helpful to consult this file because it contains commented information about
various styles that apply to the widget.

2

Use the following table to locate the appropriate CSS rule, and then change the default properties, or add your own

text styling properties and values:

Text to style

Relevant CSS rule

Relevant properties to change

Error message text

.checkboxRequiredState .check-
boxRequiredMsg, .checkboxMinSe-
lectionsState .checkboxMinSelec-
tionsMsg,
.checkboxMaxSelectionsState
.checkboxMaxSelectionsMsg

color: #CC3333; border: 1px solid
#CC3333;

September 4, 2007