Defines elements of a FORM, which are either hidden or can be completed by
the user. Types of elements that can be defined include button, checkbox,
file, hidden, image, password box, radio button, reset button, submit button and
a text box. See also FORM, SELECT
and TEXTAREA.
Attributes
ALIGN
Only used if type is set to 'image'.
Specifies the alignment. The possible values
are:
Value
absbottom
absmiddle
baseline
bottom
left
middle
right
texttop
top
ALT
Only used if type is set to 'image'.
This tag shows a description of the image if the user has disabled images in
their browser or if the image was not found. In Internet Explorer, this
text is shown when the mouse if hovered over the image.
CHECKED
If the type is set to 'checkbox' or 'radio', it will be checked.
DISABLED
Disables the element.
MAXLENGTH
Only used if type is set to 'text'.
Defines the maximum length of a textbox or password box.
NAME
Specifies the name for the element so that it can be identified by a form.
All Radio buttons that you want to be in the same group, must have the same
name.
READONLY
Only used if type is set to 'text'.
If set, the user will not be able to edit the textbox.
SRC
Only used if type is set to 'image'.
Specifies the image's URL. To show to an image on the same site use the
local path e.g. src="button.gif" or src="folder/photo1.jpg".
You can also use dots to link to an image in the parent folder e.g. src="..\diagram.png".
To show a picture from another site, use the full URL e.g. src="http://www.martin2k.co.uk/tgflogo.gif".
TYPE
Type
Meaning
button
A button
checkbox
A checkbox
file
Creates a textbox and a browse button. It is used to browse for a
file, which then goes into the textbox.
hidden
A hidden field. E.g. in some forms you can specify that the IP
address of the user is sent along with the other fields.
image
An image button
password
A textbox, where the characters are replaced by symbols (such as an
asterisk) to hide what is entered.
radio
A radio button. Only one radio button in a group can be selected.
reset
A button, used to reset the contents of a form
submit
A button, used to submit the contents of a form
text
A text box
VALUE
Specifies the value of the element. For the three button types, this
defines the caption. For checkboxes and radio buttons, it defines the text
that is passed to the script. For hidden, text and password elements, it
defines the initial value.
<input type="radio" name="CB1"
value="Left radio button" checked>Left radio button <input
type="radio" name="CB1" value="Right radio
button">Right radio button