HTML and CSS Reference
to a form.
If the password entered by the user has a length of 0 characters, an alert message
If the password entered by the user has a length of less than 6 characters, an alert
message is sent.
If the value of the password entered by the user contains any character that is not
an alphabetic character and not a number, an alert message is sent.
If the password was at least 6 characters and contained only alphanumeric char-
acters (letters and numbers), then the validation test was passed, and the user is
alerted. A value of true is returned to the onSubmit handler, allowing the form to
The HTML form called passchk is started here. Its onSubmit handler is triggered
when the user clicks the submit button.
The input type is a password box, called pass . This is where the user will enter his
or her password. See Figure 11.50.
Figure 11.50 The user enters a password of less than 6 characters (left) or enters a
password that contains illegal characters (right).
Any Web site that is trying to sell you something will have a form. They are at the heart
of Web commerce. This chapter focused on how to create forms and different input
devices used to collect the data, textboxes, checkboxes, drop-down menus, and so on.
change the text in a box, verify that there was any input, stop a submission, open up