HTML and CSS Reference
In-Depth Information
Click the OK button, and enter an age that is 18 or greater. Click the submit button.
Figure 14.23 shows data in the Name and Age input boxes and the alert message that
displays after the submit button has been clicked. It also shows the resulting Web page
after the successful submission when all data is valid.
Figure 14.23
validateform.html file
displayed in the
browser, with valid
input in the Name
and Age boxes and
alert message; the
browser on the right
shows the Web
page displayed after
valid input has been
1. What is meant by the term “form data validation”?
2. Give three examples of form data that may require validation.
3. An XHTML document contains the <form> tag as follows:
<form method="post"
onsubmit="return validateForm();">
What happens when the user clicks the submit button?
14.10 Accessibility and JavaScript
Focus on Accessibility
The interactivity and functionality that JavaScript can add to a Web page is exciting.
However, be aware that some visitors may have JavaScript disabled, may not be able to
see your visual effect, or may be unable to manipulate the mouse. Section 508 requires
that your site is functional at a basic level even if your visitor's browser does not sup-
port JavaScript. If you use JavaScript to handle mouse events in your site navigation,
you should also provide plain text navigation that does not require a mouse and can be
easily accessed by a screen reader. If you use JavaScript for form validation, provide an
e-mail address to provide physically challenged visitors a way to contact your organiza-
tion and obtain assistance.
Search WWH ::

Custom Search