tommytx

how to load an input based on reading the name of the input?

7 posts in this topic

Can someone help me out here.. what am i doing wrong.

$oInputs = _IETagNameGetCollection($oIE, "input")

For $oInput In $oInputs
   if $oInput.name = "q" then msgbox(0,"","Hello Dolly.")
   if $oInput.name = "q" then $oInput.value = "Goodbye Sally")
Next

The first command works.. pops up Hello Dolly... but next line fails.

I am scanning all input boxes on the page and if one has a name = 'p' then I want to dump the "Goodbye Sally into that input box..

Thanks..

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

SO sorry i am not smart enough to fill in all the blanks to be able to run that code, all I got was errors..

#include <IE.au3>
$oInputs = _IETagNameGetCollection($oIE, "input")
For $oInput In $oInputs
    if $oInput.name = "q" then msgbox(0,"","Hello Dolly.")
    if $oInput.name = "q" then $oInput.value = "Goodbye Sally")
        Next
2257 But then I would guess the issue is in the Q  "q"  if $oInput.name = "q" then $oInput.value = "Goodbye Sally")
if $oInput.name = "s" then $oInput.value = "Goodbye Sally")
Then that is just a uneducated guess..

"C:\AutoIt3\Code\00_xxxx\xxxxxx\CkPoints\gh.au3"(2,40) : warning: $oIE: possibly used before declaration.
$oInputs = _IETagNameGetCollection($oIE,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\AutoIt3\Code\00_xxxxx\xxxxxx\CkPoints\gh.au3"(5,60) : error: syntax error
    if $oInput.name = "q" then $oInput.value = "Goodbye Sally")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\AutoIt3\Code\00_xxxxxx\xxxxxxxxx\CkPoints\gh.au3"(2,40) : error: $oIE: undeclared global variable.
$oInputs = _IETagNameGetCollection($oIE,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\AutoIt3\Code\00_xxxxxxx\xxxxxxx\CkPoints\gh.au3 - 2 error(s), 1 warning(s)
2295
Edited by meows

Share this post


Link to post
Share on other sites

1.  You have a parenthesis at the end of the string "Goodbye Sally") <-- That doesn't belong

2.  Are you sure the object has the "value" attribute associated with it?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

also, have a look to the _IEFormElementSetValue() function


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Thanks Smoke_N... I cannot believe I missed the ) at the end of the line.. sooo... obvious.. makes me feel like a dummy... but thanks again anyway..

And to the other commenters... much appreciated... for you assistance.

Share this post


Link to post
Share on other sites

Meow,
Wow.. just noticed all the errors you got... that is weird.. my first part worked fine.. the message popup... only the second command failed the attempt to dump text in an input box named "p" so you might run it again.. mine works perfect now that Smok_N drew my attention the my dumb mistake of adding an extra ) on the end...  just curious why your test would be massive errors?  Thanks..

Share this post


Link to post
Share on other sites

Tommytx - Because $oIE does not exist. 


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
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