input type="image" ElementThe input type="image" element is an inline element declared by the XHTML 1.1 Forms Module but is not present in the
*W3C XHTML 1.1 Basic Forms Module
Elements in the Forms Module are:form | label | textarea | select | optgroup | option | button | fieldset | legend | input type="button" | input type="checkbox" | input type="file" | input type="hidden" | input type="image" | input type="password" | input type="radio" | input type="reset" | input type="submit" | input type="text"
The input type="image" element
creates a graphical submit button for a form.
Its functionality is similar to that of the
input type="submit" element,
in that pressing it causes the form to be submitted, but with two major differences:
src attribute) instead of being rendered in the user-agent's default button style (based
upon the text in the value attribute).alt attribute is rendered in place of the image. Bear in mind, however, that some user
agents will not render this alternative text in such a way that it is obvious
it represents a button - this may cause confusion to the user.input type="image"
button, two name=value pairs representing the coordinates activated within the image are
sent to the processing URI (see the Server-side Image Map Module).
This differs from the standard input type="submit" behaviour,
where only one name=value pair is sent, with the value containing the button text.value attribute in a separate pair
for input type="image" elements, but this is not common and
should not be relied upon - this is why the value attribute has not been
listed among the Specific Attributes on this page.For example, the submit button below will send the name=value pairs
img.x=xpos and img.y=ypos to the
processing URI if this button is used to submit the enclosing form.
[ Here, xpos is the x pixel coordinate (from the left of the image) and
ypos is the y pixel coordinate (from the top of the image). ]
This example button is contained below in a
method="get"
form. If you press it, you will reload
this page with the two coordinate name=value pairs appended to the
URI as a query string just prior to the
fragment identifier for this "Further Information" section (#details).
For other types of submit button see the
input type="submit"
and button elements.
Although the type attribute is not #REQUIRED
on the input element, its default value is "text" and so must be present on input type="image".
input type="image" element are listed below:accesskey [ type Character ]alt [ type Text ]Note: Although technically optional, you should always include alternative text for your graphical buttons, which will be displayed in place of the image if images are disabled in or not supported by the user agent.
disabled [ type Boolean ]name [ type CDATA ]Note: I have not included a value attribute for this element since not all user agents pass this data to the processing URI. Some (e.g. the Firefox 3 browser I am currently using) pass it as an extra name=value pair - in addition to the two (x and y) coordinate pairs - but many do not (e.g. Opera) and so this behaviour should not be relied upon.
Note: Although technically optional, a note in the *Forms Module DTD says that the name attribute is required on all input elements except "submit" and "reset".
If, despite this note, no name attribute is specified on an input type="image" element, many browsers send x=xpos and y=ypos pairs to the processing URI on button activation (instead of the name-qualified pairs). This should be borne in mind, especially if you are using other form controls with the names "x" or "y".
src [ type URI ]tabindex [ type Number ]onblur [ type Script ]onfocus [ type Script ]input type="image" element are listed below:class [ type NMTOKENS ]id [ type ID ]style [ type CDATA ], from the Style Attribute Module (deprecated)title [ type Text ]xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]dir [ type Enumeration (ltr | rtl) ], from the Bi-directional Text Modulexml:lang [ type LanguageCode ]All attributes in the
Events Attribute Collection
are supported:onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
input type="image" element is:
EMPTY
See Content Model & Nesting for information about Content Model syntax and Nesting Groups.
input type="image"This element is empty and may have no children.
input type="image"abbr, acronym, address, cite, code, dfn, div, em, h1 - h6, kbd, p, q, samp, span, strong, varadd, dt, licaption, td, thfieldset, label, legendb, big, i, small, sub, sup, ttdel, insbdoobjectrb, rt