INPUT - Input field

Appearance: <INPUT TYPE=x NAME=y>
Attributes: TYPE=text|password|checkbox|radio|submit|reset|file|hidden|image, NAME=string, VALUE=string, CHECKED, SIZE=n, MAXLENGTH=n, SRC=URL, ALIGN=top|middle|bottom|left|right
Contents: None (Empty).
May occur in: BODY, H1, H2, H3, H4, H5, H6, P, LI, DT, DD, DIV, CENTER, BLOCKQUOTE, FORM, TD, TH, PRE, ADDRESS as well as TT, I, B, U, STRIKE, BIG, SMALL, SUP, SUB, EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, A, IMG, FONT, APPLET, BR, SCRIPT, MAP, INPUT, SELECT, TEXTAREA and plain text, but must be inside a FORM.

The INPUT tag is probably the most useful tag inside forms. It can generate buttons, input fields and checkboxes. In all cases, the NAME attribute must be set.

TYPE=text
This generates a input field, where the user can enter up to MAXLENGTH characters. The SIZE attribute lists the length of the input field (if the user enters more characters, the text will scroll).
TYPE=password
Same as TYPE=text, but the text will be hidden by "*" or similar characters. It is still sent in the clear to the server, though.
TYPE=checkbox
Produces a checkbox. It has two states, on and off. When it is on when the form is submitted, it will be sent as "name=on", otherwise it is ignored altogether. If you use CHECKED, it will come up checked (selected) initially.
TYPE=radio
Produces a radio button. A radio button always exists in a group. All members of this group should have the same NAME attribute, and different VALUEs. The VALUE of the selected radio button will be sent to the server. You should specify CHECKED on exactly one radio button, which then will come up selected initially.
TYPE=submit
Produces a button, which when pressed sends the contents of the form to the server. You can have more than one submit button in the form. Each should have a different NAME. The name and value of the pressed button will be sent to the server as well.
TYPE=reset
Also produces a button, which will restore the form to its original state if pressed.
TYPE=file
Allows the user to upload a file. It is still very new, so it is not very widely supported.
TYPE=hidden
Allows you to embed information in the form which you do not want changed. This can be useful if the document is generated by a script and you need to store state information. NAME and VALUE of this input field will be sent to the server without modifications.
TYPE=image
Functions similar to a submit button, but uses an image instead. The ALIGN attribute controls the alignment of the image. The coordinates of the selected region will also be sent to the server, in the form of "NAME.x=n&NAME.y=n". A text browser will treat it as identical to a normal submit button.

Notes:


Web Design Group
Reference index ~ Wilbur index ~ Tag overview ~ Feedback

Copyright © 1996 Arnoud "Galactus" Engelfriet.