input (type="image")NN 6 IE 4 DOM 1  

  

The image-type input object is first and foremost a button-like form control element, but with several characteristics of an img element, as well. Its default behavior is that of a submit-type button. The coordinates of the mouse click within the image's rectangle are passed as form data (in the format elemName.x=65&elemName.y=44) when the form is submitted. Note that unlike most other input element types, this input type was not scriptable in early browsers. IE for Windows may not recognize a reference to this element via the enclosing form. Accessing the form via its ID is completely reliable, however.

 
HTML Equivalent
 
<input type="image">
 
Object Model Reference
 
[window.]document.formName.elementName
[window.]document.forms[i].elements[i]
[window.]document.getElementById("elementID")
 
Object-Specific Properties
 
altcompletedynsrcformheight
hspacelooplowsrcnamesrc
starttypeuseMapvspacewidth
 
Object-Specific Methods
 
handleEvent[ ]
 
Object-Specific Event Handler Properties
 
HandlerNNIEDOM
onblurn/a4n/a
onclick232
onfocusn/a4n/a
onmousedown442
onmousemove642
onmouseout642
onmouseover642
onmouseup442
altNN 6 IE 4 DOM 1  

Read/Write  

Provides text to be displayed (or spoken) where the image-type input element appears on the page when a browser does not download graphics (or is waiting for the image to download). See the alt property of the img object for more details.

completeNN n/a IE 4 DOM n/a  

Read-only  

Reveals whether the image-type input element's src or lowsrc image file has fully loaded. See the complete property of the img object for more details.

dynsrcNN n/a IE 4 DOM n/a  

Read/Write  

Provides the URL of a video clip to be displayed through the image-type input element's image. See the dynsrc property of the img object for more details.

formNN 6 IE 4 DOM 1  

Read-only  

Returns a reference to the form element that contains the current element. When processing an event from this element, the event handler function automatically has access to the input element (as the event object's target or srcElement property). By reading the form property, the script can easily access other controls within the same form.

 
Example
 
var theForm = evt.srcElement.form;
 
Value

form element object reference.

 
Default

None.

height, widthNN n/a IE 4 DOM n/a  

Read/Write  

Indicate the height and width in pixels of the image rendered in the input element. See the height and width properties of the img object for more details.

hspace, vspaceNN n/a IE 4 DOM n/a  

Read/Write  

Indicate the pixel measure of horizontal and vertical margins surrounding an image-type input object. See the hspace and vspace properties of the img object for more details.

loopNN n/a IE 4 DOM n/a  

Read/Write  

If you specify a video clip with the dynsrc attribute, the loop property controls how many times the clip should play (loop). See the loop property of the img object for more details.

lowsrcNN n/a IE 4 DOM n/a  

Read/Write  

Provides the URL of a lower-resolution (or alternate) image to download into the document space if the image of the src attribute will take a long time to download. See the lowsrc property of the img object for more details.

nameNN 2 IE 3 DOM 1  

Read/Write  

This is the identifier associated with the form control. The value of this property is submitted associated with click coordinate values (within the image's rectangle) when the form is submitted in the format elemName.x=65&elemName.y=44. These coordinates take the place of the value attribute and property of other types of input elements. Despite the modern standards' preference for the id attribute, many browsers still require that a form control be assigned a name attribute to allow the control's value to be submitted.

 
Example
 
document.orderForm.myButton.name = "Win32";
 
Value

Case-sensitive string identifier that follows the rules of identifier naming: it may contain no whitespace, cannot begin with a numeral, and should avoid punctuation except for the underscore character.

 
Default

None.

srcNN 6 IE 4 DOM 1  

Read/Write  

Provides the relative or complete URL of the image file currently loaded or to be loaded into the image-type input element. See the src property of the img object for more details.

startNN n/a IE 4 DOM n/a  

Read/Write  

If you specify a video clip with the dynsrc attribute, the start property controls the action that causes the clip to start running. See the start property of the img object for more details.

typeNN 6 IE 4 DOM 1  

Read-only  

Returns the type of form control element. The value is returned in lowercase letters. It may be necessary to cycle through all form elements in search of specific types to do some processing on (e.g., emptying all form controls of type "text" while leaving other controls untouched).

 
Example
 
if (document.forms[0].elements[3].type == "image") {
    // process image input type here
}
 
Value

Any of the following constants (as a string): button | checkbox | file | hidden | image | password | radio | reset | select-multiple | select-one | submit | text | textarea.

 
Default

image

useMapNN 6 IE 4 DOM 1  

Read/Write  

Provides the URL of the map element in the same document that contains client-side image map hot areas and links to be applied to the image. See the useMap property of the img object for more details.

vspace  

  

See hspace.

width  

  

See height.

handleEvent[ ]NN |4| IE n/a DOM n/a  

handleEvent(event)

  

Instructs the object to accept and process the event whose specifications are passed as the parameter to the method. The object must have an event handler for the event type to process the event. Navigator 4 only.

 
Parameters
 
  • A Navigator 4 event object.
 
Returned Value

None.