The Input Element in HTML
The Input Element in HTML
-----
%coreattrs, %i18n, %events -what kind of widget is needed -submit as part of form -Specify for radio buttons and
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
#IMPLIED
-----------------
for radio buttons and check boxes -unavailable in this context -for text and passwd -specific to each type of field -max chars for text fields -for fields with images -short description -use client-side image map -use server-side image map -position in tabbing order -accessibility key character -the element got the focus -the element lost the focus -some text was selected -the element value was changed -list of MIME types for file upload
This attribute tells the user agent the initial width of the control. The
width is given in pixels except when type attribute has the value "text"
or "password". In that case, its value refers to the (integer) number of
characters.
maxlength = number [CN]
When the type attribute has the value "text" or "password", this
attribute specifies the maximum number of characters the user may
enter. This number may exceed the specified size, in which case the
user agent should offer a scrolling mechanism. The default value for this
attribute is an unlimited number.
checked [CI]
When the type attribute has the value "radio" or "checkbox", this
boolean attribute specifies that the button is on. User agents must
ignore this attribute for other control types.
src = uri [CT]
When the type attribute has the value "image", this attribute specifies
the location of the image to be used to decorate the graphical submit
button.
Attributes defined elsewhere
align (alignment)
Use multiple submit buttons (each with its own image) in place of
a single graphical submit button. Authors may use style sheets to
control the positioning of these buttons.
Use a client-side image map together with scripting.
reset
Creates a reset button.
button
Creates a push button. User agents should use the value of
the value attribute as the button's label.
hidden
Creates a hidden control.
file
Creates a file select control. User agents may use the value of
the value attribute as the initial file name.
Please consult the section on intrinsic events for more information about
scripting and events.
The following example shows how the contents of a user-specified file may be
submitted with a form. The user is prompted for his or her name and a list of
file names whose contents should be submitted with the form. By specifying
the enctype value of "multipart/form-data", each file's contents will be
packaged for submission in a separate section of a multipart document.
<FORM action="http://server.dom/cgi/handle"
enctype="multipart/form-data"
method="post">
<P>
What is your name? <INPUT type="text" name="name_of_sender">
What files are you sending? <INPUT type="file" name="name_of_files">
</P>
</FORM>