HTML Forms: INPUT Tag
This tag allows the easy input of a single word or line of text,
and typically defaults to a width of 20 characters.
You will usually precede it with some descriptive text.
This example shows a simple form for asking a user their name.
It presupposes aCGI script to process the
user's response.
<FORM ACTION = "test.cgi">
Enter your name:
<INPUT TYPE = text
SIZE = 20
>
<INPUT TYPE = SUBMIT
VALUE = "Send!"
</FORM>
Here's how it looks (non-functional):
TYPE which can be one of
Text, Number, Password, Checkbox, Radio, Submit, Reset.
If omitted, Text is the default.
The first 3 take text input from some platform-appropriate text-entry
area, and the last 4 are represented typically as buttons or checkboxes.
So the "Input" syntax is being somewhat overloaded..
NAME
Field name.
Used by the form processor to identify data items.
VALUE
Assigns a default value to the field.
You can specify text which you
want to appear in the text entry field when the form is first loaded.
SIZE
Specifies how large an area to allocate on screen, in characters.
Note: the user can always type more characters than this
amount, and the text will just scroll to the left within the field.
MAXLENGTH
To limit the number of characters the user can input.
The form will give an error beep if the
user tries to type in more than the allowed MAXLENGTH.
|