INPUT TYPE="PASSWORD"


Password type input is similar to that of the text box. Both allow for one line of text to be entered by the viewer. The difference is that the input is shown as asterisks. It uses the following syntax:

<INPUT TYPE="PASSWORD" NAME="name of variable" VALUE="value" SIZE="size" MAXLENGTH="length">

Where INPUT TYPE="PASSWORD" specifies the input to be a text box with text as asterisks.

The NAME is the name of the variable. For example, NAME="secret_code". The user would input a number or a string of characters and that number or string would be the value assigned to the name of the variable "secret_code".

Only <INPUT TYPE="PASSWORD" NAME="name of variable"> is required syntax for the input. The other attributes are optional.

If the VALUE attribute is specified that value will appear in the text box. This is used to save some typing. The user can override this.

The SIZE attribute denotes the size of the text box. The SIZE is specified in number of characters. The default SIZE varies from browser to browser.

The MAXLENGTH attribute limits the length of the input character string. MAXLENGTH can be greater than SIZE, in which case the text box will scroll, or MAXLENGTH can be less than or equal to SIZE.


Here is a basic example:
Please enter country of residence:<BR>
<INPUT TYPE="PASSWORD" NAME="country">

It generates a text box that looks like this:
Please enter country of residence:

Here is an example with the options specified:
Please enter country of residence:<BR>
<INPUT TYPE="PASSWORD" NAME="country" VALUE="United States of America" 
SIZE="24" MAXLENGTH="24">

It generates a text box that looks like this:
Please enter country of residence:

Is there another hidden type of form input?

[INDEX] [PREVIOUS] [NEXT PAGE] [CHAPTER 9]

Valid HTML 3.2!