Function Reference

_IEFormGetObjByName

Returns an object reference to a Form by name.

#include <IE.au3>
_IEFormGetObjByName ( ByRef $o_object, $s_name [, $i_index = 0] )

 

Parameters

$o_object Object variable of an InternetExplorer.Application, Window or Frame object
$s_name Specifies the name of the Form you wish to match
$i_index Optional: If Form name occurs more than once, specifies instance by 0-based index
0 (Default) or positive integer returns an indexed instance
-1 returns a collection of the specified Forms

 

Return Value

Success: Returns an object variable pointing to the Form object, @EXTENDED = form count
Failure: Returns 0 and sets @ERROR
@Error: 0 ($_IEStatus_Success) = No Error
3 ($_IEStatus_InvalidDataType) = Invalid Data Type
7 ($_IEStatus_NoMatch) = No Match
@Extended: Contains invalid parameter number

 

Remarks

None.

 

Related

None.

 

Example


; *******************************************************
; Example 1 - Get a reference to a specific form by name.  In this case, submit a query
;               to the Google search engine.  Note that the names of the form and form
;               elements can be found by viewing the page HTML source
; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForm = _IEFormGetObjByName ($oIE, "f")
$oQuery = _IEFormElementGetObjByName ($oForm, "q")
_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
_IEFormSubmit ($oForm)