Function Reference

_IEFormGetCollection

Returns a collection object variable representing the Forms in the document.

#include <IE.au3>
_IEFormGetCollection ( ByRef $o_object [, $i_index = -1] )

 

Parameters

$o_object Object variable of an InternetExplorer.Application, Window, Frame or iFrame object
$i_index Optional: specifies whether to return a collection or indexed instance
0 or positive integer returns an indexed instance
-1 = (Default) returns a collection

 

Return Value

Success: Returns an object variable with a collection of all forms in the document, @EXTENDED = form count
Failure: Returns 0 and sets @ERROR
@Error: 0 ($_IEStatus_Success) = No Error
3 ($_IEStatus_InvalidDataType) = Invalid Data Type
5 ($_IEStatus_InvalidValue) = Invalid Value
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 0-based index,
;               in this case the first form on the page
; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 1)
_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
_IEFormSubmit ($oForm)

; *******************************************************
; Example 2 - Get a reference to the collection of forms on a page,
;               and then loop through them displaying information for each
; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com")
$oForms = _IEFormGetCollection ($oIE)
MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
For $oForm In $oForms
    MsgBox(0, "Form Info", $oForm.name)
Next