HTML/Elements/input/image

From Web Education Community Group
< HTML‎ | Elements‎ | input
Revision as of 14:34, 12 March 2012 by Hiroki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<input type="image">

The image button state represents either an image from which a user can select a coordinate and submit the form, or alternatively a button from which the user can submit the form. The element is a button, specifically a submit button.

HTML Attributes

  • alt = string
    Provides a textual label for an alternative button for users and UAs who cannot use the image specified by the src attribute. The alt attribute must also be present.


  • formaction = valid URL potentially surrounded by spaces
    Specify the form-submission action for the element.


  • formenctype = application/x-www-form-urlencoded / multipart/form-data / text/plain
    Specfy a MIME type with which a UA is meant to associate this element for form submission.
    The missing value default for these attributes is the application/x-www-form-urlencoded state.
    • application/x-www-form-urlencoded
    • multipart/form-data
    • text/plain


  • formmethod = get/ post
    Specify the HTTP method with which a UA is meant to associate this element for form submission.
    The missing value default for this attributes is the GET state.
    • get
      Indicating the HTTP GET method.
    • post
      Indicating the HTTP POST method.


  • formnovalidate = boolean
    If present, they indicate that the form is not to be validated during submission.


  • formtarget = valid browsing context names or keywords
    Specfy a browsing context name or keyword that represents the target of the control.


  • name = string
    Gives the name of the input element.


  • src = valid non-empty URL potentially surrounded by spaces
    Specifies the location of an image. The src attribute must be present.


  • value = string
    Gives the default value of the input element.


Example

Example A

[try it]

<p><label>First name: <input type="text" name="fistname"></label></p>
<p><label>Last name: <input type="text" name="lastname"></label></p>
<p><label>E-mail: <input type="email" name="e-mail"></label></p>
<p><input type="image" src="submit.jpg" alt="submit"></p>

HTML Reference

The HTML5 specification defines the Image state in 4.10.7.1.20 IMAGE BUTTON STATE.