Function Reference

_IEFormImageClick

Simulate a mouse click on an <input type=image>. Match by sub-string match of alt text, name or src.

#include <IE.au3>
_IEFormImageClick ( ByRef $o_object, $s_linkText [, $s_mode = "src" [, $i_index = 0 [, $f_wait = 1]]] )

 

Parameters

$o_object Object variable of any DOM element (will be converted to the associated document object)
$s_linkText Value used to match element - treatment based on $s_mode
$s_mode Optional: specifies search mode
src = (default) match the url of the image
name = match the name of the image
alt = match the alternate text of the image
$i_index Optional: If the img text occurs more than once, specifies which instance you want by 0-based index
$f_wait Optional: specifies whether to wait for page to load before returning
0 = Return immediately, not waiting for page to load
1 = (Default) Wait for page load to complete before returning

 

Return Value

Success: Returns -1
Failure: Returns 0 and sets @ERROR
@Error: 0 ($_IEStatus_Success) = No Error
1 ($_IEStatus_GeneralError) = General Error
3 ($_IEStatus_InvalidDataType) = Invalid Data Type
4 ($_IEStatus_InvalidObjectType) = Invalid Object Type
5 ($_IEStatus_InvalidValue) = Invalid Value
6 ($_IEStatus_LoadWaitTimeout) = Load Wait Timeout
7 ($_IEStatus_NoMatch) = No Match
8 ($_IEStatus_AccessIsDenied) = Access Is Denied
@Extended: Contains invalid parameter number

 

Remarks

The <input type=image> form element is handled differently from all others. It is not recognized by Internet Explorer as a member of the form element collection and this function therefore gives you other means of getting a reference to it within the document using src, name or alt strings. Regardless of the object passed to this function, it looks for the form element within the full document context.

 

Related

_IEImgClick

 

Example


; *******************************************************
; Example 1 - Open a browser with the form example, click on the
;               <input type=image> form element with matching alt text
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
_IEFormImageClick ($oIE, "AutoIt Homepage", "alt")

; *******************************************************
; Example 2 - Open a browser with the form example, click on the <input type=image>
;               form element with matching img source URL (sub-string)
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
_IEFormImageClick ($oIE, "autoit_6_240x100.jpg", "src")

; *******************************************************
; Example 3 - Open a browser with the form example, click on the
;               <input type=image> form element with matching name
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
_IEFormImageClick ($oIE, "imageExample", "name")