HTML and CSS Reference
In-Depth Information
Password Box. The <input /> tag configures this form control. The password box is
similar to the text box but it accepts information that needs to be hidden as it is entered,
such as a password. When the user types information in a password box, asterisks (*)
are displayed instead of the characters that have been typed, as shown in Figure 9.6.
Figure 9.6
The characters
secret999 were
typed, but the
browser displays
********* ( Note : your
browser may use a
different symbol to
“hide” the
This hides the information from someone looking over the shoulder of the person
typing. The actual characters typed are sent to the server and the information is not
really secret or hidden. See Chapter 12 for a discussion of encryption and security.
The XHTML code follows:
Password: <input type="password" name="myPassword"
id="myPassword" />
Common password box attributes are listed in Table 9.3.
Table 9.3 Common password box attributes
Configures the password box.
Alphanumeric, no spaces,
begins with a letter
Names the form element so that it can be easily accessed by
client-side scripting languages or by server-side processing.
The name should be unique.
Alphanumeric, no spaces,
begins with a letter
Provides a unique identifier for the form element.
Configures the width of the password box as displayed by the
browser. If size is omitted, the browser displays the password box
with its own default size.
Optional. Configures the maximum length of data accepted by the
password box.
Text or numeric
Assigns an initial value to the text box that is displayed by the
browser. Accepts the information typed in the password box. This
value can be accessed by client-side and by server-side processing.
Check Box. This form control is configured by the <input /> tag and allows the user
to select one or more of a group of predetermined items. A sample check box is shown
in Figure 9.7.
Search WWH ::

Custom Search