| | Help and How-to Training Related Products and Technologies Support and Feedback Technical Resources Additional Resources | Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.
Set rules for allowing data in fields
To make your forms more useful, you can control what site visitors enter into certain form fields by setting data entry rules (also called validation). You can apply data entry rules to drop-down boxes, text boxes, text areas, and option buttons. In Page view, at the bottom of the document window, click Design . - Do one or more of the following:
Set data entry rules for a drop-down
box
- Double-click the drop-down box for which you want to set
validation rules.
Be sure to double-click the drop-down box itself, not the
Submit or
Reset button.
- In the
Drop-Down Box Properties dialog
box, do one or more of the following:
Allow multiple selections from a
drop-down box
- To allow multiple selections, click
Yes.
- Click
Validate.
- Type values in the
Minimum Items and
Maximum Items boxes, and then
click
OK.
Use the first option in the drop-down box to provide instructions to site visitors.
If you use the first option to display instructions, such as "Select an option," do the following to make that first option unavailable:
- Click
Validate.
- Select
the Disallow first item check box.
Require site visitors to make a
selection from a drop-down box
- Click
Validate.
- Select
the Data required check box, and then click
OK.
Display a message to site visitors
who have not met the requirements you set
- Click
Validate.
- In the
Display Name box, type a brief reminder to site visitors about meeting your requirements. For example, they
would see "Select an option."
Set data entry rules for a text box or text
area
- Double-click the text box or text area for which you want to set validation
rules.
Be sure to double-click the text box or text area itself, not the
Submit or
Reset button.
- In the
Text Box Properties or the TextArea Box Properties dialog box,
click
Validate, and do one or more of the following:
Specify the type of data to allow in
a text box or text area field
In the
Data type list, do one of the
following:
- Select
No Constraints from the Data type list.
- Select
Text from the Data type list, and then
under Text format select the types of characters to allow in the field —
Letters,
Digits,
Whitespace (spaces, tabs, carriage
returns, and line feeds), or
Other (different characters, such as
commas and hyphens). If you select
Other, type the characters in the
box.
- Select
Integer from the Data type list, and
then under Numeric format specify to use a comma, period, or space to group numbers.
You can disallow any punctuation or spacing, or allow periods in groups
of numbers as in 123.456.789, allow commas as in
123,456,789, or allow spaces as in 123 456 789.
- Select
Number from the Data type list, and then
under Numeric format specify the character to allow for
Grouping and the character to use for
Decimal points.
You cannot use the same character for both
Grouping and
Decimal. For example, if you use a period as a decimal point, you cannot use a period for grouping. Instead, you could use the comma, space, or no punctuation for grouping, for instance: 1,234.56, or 1 234.56, or 1234.56.
Specify a value limitation
- Under
Data value, select
the Field must be check box.
- In the Field must be list, click a data value.
- In the
Value box, type the value for the
constraint, for example, you might require that a value in the field be greater than 10.
- To specify a second constraint, select
the And must be check box, click a condition,
and then type a value.
Note The validation rule will use numerical comparisons if the
data type is
Number or
Integer, and alphabetical-order
comparisons if the data type is
Text or
No Constraints.
Require site visitors to type an
entry in a text box or text area field
- Under
Data length, select the
Required check box.
- To specify the minimum number of characters to allow in the
text box, type a value in the
Min length box.
- To specify the maximum number of characters to allow in the
text box, type a value in the
Max length box.
Display a message to site
visitors who have not met the requirements you set.
In the
Display name box, type a brief reminder to site visitors about meeting your requirements. For example, they would
see "Select an option."
Set data entry rules for an option
button
- Double-click an option button in the group for which you want to
set a rule.
Be sure to double-click the option button itself, not the
Submit or
Reset button.
- In the
Option Button Properties
dialog box, click
Validate.
- Then do one or both of the following:
Require site visitors to select
an option button
Select
the Data required check box.
Display a message to site
visitors who have not selected an option button.
-
Select the
Data required check box.
- In the
Display name box, type a brief reminder to site visitors about meeting your requirements. For example, they would see "Select an option."
Note When you set a rule for the selection of one option button at a time, the rule applies to all option buttons in the group.
Note To test the functionality of your form, you must first publish
your Web site to a Web server.
|