
|
 |
 |

The <INPUT> tag has can have various attributes which create a specific type of field. It is also an empty tag, it has no closing tag. The attribute that controls which type is the TYPE attribute. This is the attribute we will be discussing for the next few sections.
TEXT
The text field is a one line area that allows the user to type in text, if you want more then one line use textarea, which is discussed further. The basic text field code will look like this:
<INPUT TYPE="text">
You can further customize it by adding more attributes to the <INPUT> tag.
The SIZE attribute specifies the width of the text field.
The MAXLENGTH attribute is the maximum characters that can be entered in this field for example a zip code will be 5. If you do not specify a value, the user may keep typing even when there is no more room to display all the characters.
The NAME attribute assigns a name to this input field. The program you will use to process this information will need to know the name of the field.
The VALUE attribute is what will display initially in the text field, you may leave it empty or display a message in here that the user can type over.
The TABINDEX attribute specifies the order in which the field will be activated by pressing the tab button.
Here is an example of a complete text field:
<FORM ACTION="#">
Enter you zip code here:
<INPUT TYPE="text" SIZE="10" MAXLENGTH="10" NAME="zip_code" VALUE="00000-0000" ALIGN="right" TABINDEX="1">
</FORM>
and here is how it will look:
© Copyright 2000-2002 by Pepmint.com. All Rights Reserved |
 |
 |
|