Falling Posted July 11, 2006 Share Posted July 11, 2006 hey if on a form there is a select like this: <select name="salutation" class="bod"> <option value="">Select one...</option> <option value="1">Mr</option> <option value="2">Mrs</option> <option value="3">Ms</option> </select> How do i use _IEFormElementOptionselect() properly to select the 2nd value? say under following circumstances: 1. Form index = 1. so. $oIE = _IECreate ($URL) $o_form = _IEFormGetCollection ($oIE,1) _IEFormElementOptionselect($o_form ,"Mr");????????????????????????? The above does not work...any idea why? thanks for any information! Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 11, 2006 Moderators Share Posted July 11, 2006 (edited) The above does not work...any idea why? thanks for any information!If you download the latest beta that was just released this morning it has great examples for each function. On that note try this: #include <IE.au3> $oIE = _IECreate ($URL) $oForm = _IEFormGetCollection ($oIE, 1) $oSelect = _IEFormElementGetObjByName($oForm, "salutation") _IEFormElementOptionselect($oSelect, "Mr", 1, "byText") Edit: fixed code & refixed code Edited July 12, 2006 by big_daddy Link to comment Share on other sites More sharing options...
DaleHohm Posted July 11, 2006 Share Posted July 11, 2006 (edited) big_daddy beat me by seconds. Although an addition is needed... this function takes the select object as input rather than the form... #include <IE.au3> $oIE = _IECreate ($URL) $oForm = _IEFormGetCollection ($oIE, 1) $oSelect = _IEFormElementGetObjByName($oForm, "salutation") _IEFormElementOptionselect($oSelect, "Mr", 1, "byText") Dale Edit: typo $oFrom -> $oForm Edited July 12, 2006 by DaleHohm 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...
Moderators big_daddy Posted July 11, 2006 Moderators Share Posted July 11, 2006 big_daddy beat me by seconds. Although an addition is needed... this function takes the select object as input rather than the form... #include <IE.au3> $oIE = _IECreate ($URL) $oForm = _IEFormGetCollection ($oIE, 1) $oSelect = _IEFormElementGetObjByName($oFrom, "salutation") _IEFormElementOptionselect($oSelect, "Mr", 1, "byText") DaleThanks, I got in a hurry and forgot about that. Link to comment Share on other sites More sharing options...
DaleHohm Posted July 11, 2006 Share Posted July 11, 2006 Thanks, I got in a hurry and forgot about that. BTW, I do agree with the OP this this is the evil-est of the functions in the library... there is no way you can guess the syntax - you must read the docs and look at the examples.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...
Falling Posted July 12, 2006 Author Share Posted July 12, 2006 where does $oFrom come from? is it the same as $oForm? Link to comment Share on other sites More sharing options...
DaleHohm Posted July 12, 2006 Share Posted July 12, 2006 where does $oFrom come from?is it the same as $oForm?Yup, typo.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...
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