asp.net.ph

Skip Navigation Links

INPUT type=image Element

HTML Elements


Creates a graphical submit button.HTML 2, 3.2, 4, 4.01, 5

HTML Syntax

Remarks

The INPUT type=image element renders a submit button with an image. The value of the src attribute specifies the URI of the image that is used on the button. For accessibility reasons, authors should provide alternate text for the image via the alt attribute.

When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image.

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, as in name.x=x-value and name.y=y-value. Any value property is ignored. The image itself is specified by the src property, exactly as for the IMG element.

If the server takes different actions depending on the location clicked, users of non-graphical browsers will be disadvantaged. For this reason, authors should consider alternate approaches:

  • 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.

Members

INPUT Members

Example


<input type="image" src="../shared/go.gif" name="whatever"
   width=32 height=32 border=0 alt="Click me">
See Also

IMG   INPUT



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note