input type=image element | input type=image object
[This documentation is preliminary and is subject to change.]
Creates an image control that, when clicked, causes the form to be immediately submitted.
![]() ![]() |
Standards information
- HTML 4.01 Specification, Section 17.4
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.10.7.1.20
HTML information
| Closing Tag | forbidden |
|---|---|
| CSS Display | inline |
DOM Information
Inheritance Hierarchy
Node
Element
HTMLElement
input type=image
Remarks
The x-coordinate is submitted under the name of the control with .x appended, and the y-coordinate is submitted under the name of the control with .y appended. Any value property is ignored. The src property specifies the img element.
The following image and video file formats are supported:
- .avi—Audio-Visual Interleaved (AVI)
- .bmp—Windows Bitmap (BMP)
- .emf—Windows Enhanced Metafile (EMF)
- .png—Graphics Interchange Format (GIF)
- .png, .jpeg—Joint Photographic Experts Group (JPEG)
- .mov—Apple QuickTime Movie (MOV)
- .mpg, .mpeg—Motion Picture Experts Group (MPEG)
- .png—Portable Network Graphics (PNG)
- .wmf—Windows Metafile (WMF)
- .xbm—X Bitmap (XBM)
See also
Build date: 3/8/2012
type="image" does not post a control name it's current value - bug
Why does IE8 ignore the "value" in the attribute named "value"? This breaks backwards compatibility with IE6, IE7, Firefox, Safari and Opera as the value is not submitted as a form post in IE8 (unlike the others which all do it). Take for instance this code:
<inputname="action"value="next"type="image"src="img/buttons/next_arrow.gif"alt="Next" />
I would assume that it would post action="next" with in the form post, however it only posts action.x="56" and action.y="45". The only way to have multiple submit buttons is to use type="submit" and therefore breaking multiple image based submit buttons. It breaks the specification set forth by the W3C which states:
"Every successful control has its control name paired with its current value as part of the submitted form data set"
Source: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2
This bug was also outlined in this blog post almost a year ago.
http://blog.singlebrook.com/2008/07/ie-bug-image-buttons-do-not-submit.html
<inputname="action"value="next"type="image"src="img/buttons/next_arrow.gif"alt="Next" />
I would assume that it would post action="next" with in the form post, however it only posts action.x="56" and action.y="45". The only way to have multiple submit buttons is to use type="submit" and therefore breaking multiple image based submit buttons. It breaks the specification set forth by the W3C which states:
"Every successful control has its control name paired with its current value as part of the submitted form data set"
Source: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2
This bug was also outlined in this blog post almost a year ago.
http://blog.singlebrook.com/2008/07/ie-bug-image-buttons-do-not-submit.html
- 5/26/2009
- MaestroFJP

