Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Creating Form Controls with the <input> Tag 333

12


To create a password control, create an input element with the type set to password. To
limit the size of the password control and the maximum number of characters a user can
enter, you can use the size and maxlength attributes just as you would in a text control.
Here’s an example:


Input ▼


id="userpassword"
size="8" maxlength="8">

Figure 12.11 shows a password control.


Output ▼


FIGURE 12.11
A password form
field.


When data entered in a password field is sent to the server, it is
not encrypted in any way. Therefore, this is not a secure means of
transmitting sensitive information. Although the users can’t read
what they are typing, the password control provides no other secu-
rity measures.

CAUTION

Creating Submit Buttons


Submit buttons are used to indicate that the user is finished filling out the form. Setting
the type attribute of the form to submit places a Submit button on the page with the
default label determined by the browser, usually Submit Query. To change the button
text, use the value attribute and enter your own label, as follows:


Free download pdf