Jump to content

_IEDocGetObj($oIE) - Text Field


Recommended Posts

I had a similar post regarding radio buttons, that was resolved with the help of another member. I am now onto another section of my script where I have a similar issue, and have re-used the code gave me and am running into a new challenge.

#include <IE.au3>

$oIE=_IECreate("C:\test2\123.html")
$oDoc = _IEDocGetObj($oIE)
$oArray = $oDoc.getElementsByTagName ("input")
for $element in $oArray
if $element.value="alt" Then $element.checked=true
next
for $element in $oArray
If $element.Value = "Submit" Then _IEAction($element, "click")
next

Went through and selected the "alt" radio button for me and submitted it. Worked perfect as I said, the new page that I am getting to has 3 radio buttons, and then a text field.

I have the text field variable stored as $textinput but I can't get it to paste into the text box before submitting. I assume there is another $element.XXXX that I don't know that I could use. Can you help me?

Is there someplace where I can reference all the element.XXX that I can use?

I have tried for the past (literally) 5 hours reading docs, and example determine to figure it out and I have given up. Your help would be appreciated. I have tried passing _IEFormElementSetValue and not matter what I do I get:

--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType

--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

I have downloaded IE Builder from DaveHolms, and I have the output of the forms section.

15 INPUT text Form Input Type: text Value: 0 DispHTMLInputElement

16 INPUT Form Input Type: submit Value: Go! DispHTMLInputElement

I am trying variations of this:

$oDoc = _IEDocGetObj($oIE)

$oArray = $oDoc.getElementsByTagName ("input")

for $element in $oArray

if $element.value="alt" Then $element.checked=true

next

for $element in $oArray

if $element.value="0" Then _IEFormElementSetValue ($oQuery, $textinput)

next

for $element in $oArray

if $element.value="text" Then $element.checked=true

next

for $element in $oArray

If $element.Value = "Submit" Then _IEAction($element, "click")

next

Link to comment
Share on other sites

$oQuery does not resolve to an object type. Read the output pane. What it's content should be?

If there another way to reference it, I am missing something...

$oForm = _IEFormGetObjByName ($oIE, "text") ;tried also text, 0, Go!

$oQuery = _IEFormElementGetObjByName ($oForm, "text")

_IEFormElementSetValue ($oQuery, $textinput)

;_IEFormSubmit ($oForm)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...