Jump to content

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


tommytx
 Share

Go to solution Solved by SmOke_N,

Recommended Posts

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..

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators
  • Solution

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.

Link to comment
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..

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...