Jump to content

Trying to click in a box in a webform.


Recommended Posts

I'm trying to set focus in a text field.

Below is the code for the field. Can someone help me with this? What happens is the page loads but doesn't but the cursor in the box. And for some reason on different computers the tab amount to be pressed to get to the box varies.

Is there _IE code that can do what Im trying to do?

CODE
<font title="Please enter your Dell Badge number here">Enter your badge number:</font>

</td>

<td align="left"><input type="text" name="badge" id="badge" value="" >

Link to comment
Share on other sites

I'm trying to set focus in a text field.

Is there _IE code that can do what Im trying to do?

<font title="Please enter your Dell Badge number here">Enter your badge number:</font>
    </td>
    <td align="left"><input type="text" name="badge" id="badge" value="" >
You've got the name "badge" and id "badge" of the input object, use _IEGetObjByID(), or _IEGetObjByName().

:rolleyes:

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You've got the name "badge" and id "badge" of the input object, use _IEGetObjByID(), or _IEGetObjByName().

:rolleyes:

I tried this code... I guess I'm doing it wrong? Any ideas?

$oIE = "http://dsn.us.dell.com/DSNCR/DSNGateway"
    $oForm = _IEFormGetCollection ($oIE, 0)
    $oBox = _IEFormElementGetObjByName ($oForm, "badge")
    _IEAction ($oBox, "click")
Link to comment
Share on other sites

I tried this code... I guess I'm doing it wrong? Any ideas?

The $oIE is an object pointing to the browser window. Try:

$oIE = _IECreate("http://dsn.us.dell.com/DSNCR/DSNGateway")
$oBox = _IEFormGetObjByName($oIE, "badge")
_IEAction ($oBox, "click")

:rolleyes:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

The $oIE is an object pointing to the browser window. Try:

$oIE = _IECreate("http://dsn.us.dell.com/DSNCR/DSNGateway")
$oBox = _IEFormGetObjByName($oIE, "badge")
_IEAction ($oBox, "click")

:rolleyes:

Didn't work. :-/

Thanks for your helping though, I appreciate it. Anything alternates other than IE functions?

Link to comment
Share on other sites

Work through the _IEForm* examples in the helpfile...

Based on what you have show, this will get data in the badge field (other calls needed to submit the form):

$oBox = _IEFormGetObjByName($oIE, "badge")
_IEFormElementSetValue($oBox, "my badge")

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Work through the _IEForm* examples in the helpfile...

Based on what you have show, this will get data in the badge field (other calls needed to submit the form):

$oBox = _IEFormGetObjByName($oIE, "badge")
_IEFormElementSetValue($oBox, "my badge")

Dale

That did not work either. Im about ready to just say screw it. I've tried pretty much everything. Even trying to go to combobox below it. Then shift tab up. But the combobox control id changes every time the page opens.
Link to comment
Share on other sites

That did not work either. Im about ready to just say screw it. I've tried pretty much everything. Even trying to go to combobox below it. Then shift tab up. But the combobox control id changes every time the page opens.

You should give up. You didn't want LEARN something did you?! :rambo:

:x

The next thing to find out is the structure of the page. The combobox object might be part of one of multiple Forms, or an Frame. Check out the IE.au3 functions to see how to get a list of those. The you can point to the correct Form/Frame to get the combobox. Check out the examples for IE.au3 in the help file for _IEFormGetCollection() and _IEFrameGetCollection().

Unless... you'd rather quit... :rolleyes:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You should give up. You didn't want LEARN something did you?! :rambo:

:)

The next thing to find out is the structure of the page. The combobox object might be part of one of multiple Forms, or an Frame. Check out the IE.au3 functions to see how to get a list of those. The you can point to the correct Form/Frame to get the combobox. Check out the examples for IE.au3 in the help file for _IEFormGetCollection() and _IEFrameGetCollection().

Unless... you'd rather quit... :rolleyes:

Definately don't want to quit. When I get more time I will work on it. When I finally get it it to work, I will post results. :x

Thanks for the help and motivation. :mad:

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