Graphics Programs Reference
In-Depth Information
Problem Solving: Providing Alternate Pages Without Behaviors
If your target audience includes users of very old browsers, you might need to create an
alternate site that does not use behaviors, in order to communicate effectively with those
users. Some discrepancy exists in the way that different browsers interpret JavaScript, so
be sure to test pages that use behaviors extensively in all the browsers you intend to sup-
port. In addition, some users turn off JavaScript in their browsers so that pop-up ads on
Web sites cannot run. This means that some users with newer browsers will still not be able
to access Web sites that use behaviors. Therefore, even if your target audience does not
include users of older browsers, consider providing links to alternate pages or an alternate
site for anyone whose browser has difficulty running JavaScript. Or, alert users that they
must enable JavaScript to view the site.
Validating Form Data
The Validate Form behavior enables you to create requirements/limits that check form
data before the form is submitted. When the user clicks the Submit button, the data is
checked to make sure the data meets the limits/requirements set for each object in the
Validate Form behavior. If information is missing or is not within the set limits, a dialog
box opens, prompting the user to change incorrect information or add missing informa-
tion and then click the Submit button again.
The Validate Form dialog box lists all the form objects. You select a fi eld and then set
its requirements/limits. You fi rst set whether the selected fi eld is required or optional. The
user must enter information into a required fi eld to submit the form. If a fi eld is optional,
the form will be submitted even if the user does not enter information in that fi eld. You
can also set the following limits for the data entered into the selected fi eld:
Anything. No limits on what the user can enter.
Number. Only numeric values. This limit is often set for fi elds that are used to input
phone numbers or zip codes.
Email address. Only information that follows the format of an e-mail address (for
example, name@domain.topleveldomain). Th is limit ensures that the submitted address
is in the correct format, but not that the user has inserted a valid e-mail address.
Number from. A range of acceptable numeric values. This limit is appropriate for a
question such as, “How old is your teenager?” The numbers would range from a low of
13 to a high of 19. If a user inputs a number less than 13 or more than 19, the Validate
Form behavior informs the user that the data is outside the acceptable range, and then
prompts the user to input an acceptable value and resubmit the form.
Adding a Behavior Using the Behaviors Panel
• In the Document window, select the object to which to add the behavior.
• In the Behaviors panel, click the Add behavior button, point to Show Events For, and
then click a browser.
• In the Behaviors panel, click the Add behavior button, and then click a behavior.
• In the Behaviors panel, click the Events arrow, and then click an event.
• You'll use the Behaviors panel to add the Validate Form behavior to the contact form.
Search WWH ::




Custom Search