beautypg.com

Insert the validation text field widget, Specify a validation type and format – Adobe Dreamweaver CS3 User Manual

Page 472

background image

DREAMWEAVER CS3

User Guide

465

The default HTML for the Validation Text Field widget, usually inside of a form, comprises a container tag
that surrounds the 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 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 bar.

See also

“Create accessible HTML forms” on page 612

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:

Validation type

Format

None

No particular format required.

Integer

Text field accepts numbers only.

Email

Text field accepts e-mail addresses that contain @ and a
period (.) that is both preceded and followed by at least
one letter.

Date

Formats vary. Make your selection from the Format pop-
up menu of the Property inspector.

Time

Formats vary. Make your selection from the Format pop-
up menu of the Property inspector. (“tt” stands for
am/pm format; “t” stands for a/p format.)

Credit Card

Formats vary. Make your selection from the Format pop-
up menu of the Property inspector. You can choose to
accept all credit cards, or specify a particular kind of
credit card (MasterCard, Visa, etc.). The text field does not
accept spaces in credit card numbers, i.e. 4321 3456 4567
4567.

September 4, 2007