Insert the validation text area widget, Specify when validation occurs, Specify a minimum and maximum number of characters – Adobe Dreamweaver CS3 User Manual

Page 477: Add a character counter, Display widget states in design view

Advertising
background image

DREAMWEAVER CS3

User Guide

470

The default HTML for the Validation Text Area widget, usually inside of a form, comprises a container <span> tag
that surrounds the <textarea> tag of the text area. The HTML for the Validation Text Area 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 Area widget works, including a full anatomy of
the Validation Text Area widget’s code, see

www.adobe.com/go/learn_dw_sprytextarea

.

Insert the Validation Text Area widget

1

Select Insert > Spry > Spry Validation Textarea.

2

Complete the Input Tag Accessibility Attributes dialog box and click OK.

Note: You can also insert a Validation Text Area widget by using the Spry category in the Insert bar.

See also

“Create accessible HTML forms” on page 612

Specify when validation occurs

You can set the point at which validation occurs—when the user clicks outside the widget, as the user types, or when
the user tries to submit the form.

1

Select a Validation Text Area widget in the Document window.

2

In the Property inspector (Window > Properties), select the Validate On 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 text field.

Change

Validates as the user changes text inside the text field.

Submit

Validates when the user tries to submit the form.

Specify a minimum and maximum number of characters

1

Select a Validation Text Area widget in the Document window.

2

In the Property inspector (Window > Properties), enter a number in the Min Chars or Max Chars box. For

example, if you enter 20 in the Min Chars box, the widget only validates if the user enters 20 or more characters in
the text area.

Add a character counter

You can add a character counter that lets your users know how many characters they have typed, or how many
characters are remaining when entering text in the text area. By default, when you add a character counter, the
counter appears outside the lower-right corner of the widget.

1

Select a Validation Text Area widget in the Document window.

2

In the Property inspector (Window > Properties), select either the Chars Count or Chars Remaining option.

Note: The Chars Remaining option is only available if you’ve already set a maximum number of characters allowed.

Display widget states in Design view

1

Select a Validation Text Area widget in the Document window.

September 4, 2007

Advertising