Ursie Posted October 4, 2006 Share Posted October 4, 2006 HTML Info ----------- <select name="paard"> <option></option> <option value='23917'>angel</option> <option value='33485'>Wyomi</option> <option value='35153'>Mitsy's Special Love</option> <option value='36656'>Sverre</option> </select> AutoIT3 Info -------------- $oSelectPaard = _IEGetObjByName ( $oIE1 , "paard" , 0 ) _IEFormElementOptionselect ( $oSelectPaard , "Sverre" , 1 , "byText" , 1 ) The above code doesn't selcet the option I want . Do i do something wrong ? or does the code struggle with the epty option or what ? To be honest I use the following code _IEFormElementOptionselect ( $oSelectPaard , $horseName , 1 , "byText" , 1 ) And $horseName consistes of "Sverre" If anybody can help me or give me some alternate code to try or to debug. Please all suggestions are welcome. Thanks in advance. P.S. I tried the "byValue" option also already but even that doesn't work only the "byIndex" does his job. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted October 4, 2006 Moderators Share Posted October 4, 2006 I don't have time to troubleshoot why it is not working, but here is a workaround until Dale has a chance to look at it. $oSelect = _IEGetObjByName($oIE, "paard") $oItems = $oSelect.Options For $oItem In $oItems If $oItem.Text = $sHorseName Then If Not $oItem.selected Then $oItem.selected = True EndIf EndIf Next Link to comment Share on other sites More sharing options...
DaleHohm Posted October 4, 2006 Share Posted October 4, 2006 Yes, in fact there is a problem here in IE.au3 with the null value/text. The value returned for the text turns out to be a numeric 0 instead of an empty string and a comparison of a (unexpected) numeric to any string evaluates to True. I'll fix this in the next release. Thanks Bob for providing the workaround. 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...
Moderators big_daddy Posted October 4, 2006 Moderators Share Posted October 4, 2006 No problem. Thanks for the explanation, now I understand why it wasn't working. Link to comment Share on other sites More sharing options...
Ursie Posted October 4, 2006 Author Share Posted October 4, 2006 (edited) Thnx guys, I was walking on my hands already. The script made me mad --> In love --> crazy well it made me everything but not happy Thnx for the workaround Edited October 4, 2006 by Ursie 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