INPUT Image Description:
The image INPUT tag uses an image as an input fields. The image can be used as a submit button (with a script to submit the form onclick) or to collect data from the image itself (similar to an image map, but in a form). The browser will submit the coordinates where the user clicked on the image.
DTD: HTML5: <!doctype html>
HTML4 Strict: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML4 Transitional or Loose: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
INPUT Image Web Browser Support:
- AvantGo Palm OS
- AvantGo Windows CE
- Chrome 1, 2, 3, 4, 5
- Firefox 1, 2, 3
- Internet Explorer 2, 3, 4, 5, 6, 7, 8
- Netscape 2, 3, 4, 6, 7, 8
- Opera 3, 4, 5, 6, 7, 8, 9, 10
- Safari 1, 2, 3, 4, 5
INPUT Image Attributes:
INPUT Image Usage:
Input image to collect coordinates
<input type="image" src=&/library/graphics/cecb2.gif">
Input image as submit button
<input type="image" src=&/library/graphics/cecb2.gif" onsubmit="submit-form();">
See an example of a plain image input tag.
INPUT Image Special Notes:
When you use the input type="image" tag, you are telling the browser to submit the x and y coordinates where the image was clicked. This allows you to add image map type functionality to your forms.