Klexen Posted June 26, 2007 Share Posted June 26, 2007 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 More sharing options...
PsaltyDS Posted June 26, 2007 Share Posted June 26, 2007 (edited) 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(). Edited June 26, 2007 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 More sharing options...
Klexen Posted June 26, 2007 Author Share Posted June 26, 2007 You've got the name "badge" and id "badge" of the input object, use _IEGetObjByID(), or _IEGetObjByName(). 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 More sharing options...
PsaltyDS Posted June 26, 2007 Share Posted June 26, 2007 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") 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 More sharing options...
Klexen Posted June 26, 2007 Author Share Posted June 26, 2007 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") Didn't work. :-/ Thanks for your helping though, I appreciate it. Anything alternates other than IE functions? Link to comment Share on other sites More sharing options...
DaleHohm Posted June 26, 2007 Share Posted June 26, 2007 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 More sharing options...
Klexen Posted June 27, 2007 Author Share Posted June 27, 2007 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 More sharing options...
PsaltyDS Posted June 27, 2007 Share Posted June 27, 2007 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?! 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... 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 More sharing options...
Klexen Posted June 28, 2007 Author Share Posted June 28, 2007 You should give up. You didn't want LEARN something did you?! 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... 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. Thanks for the help and motivation. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now