Sign in to follow this  
Followers 0
furrycow

Selecting value from drop-down box IE

4 posts in this topic

Hey,

ok, so over the past view days i have successfully learned how to select radio buttons in IE and all that jazz, and i know how to select and choose a value in a drop down box..but the html for this object is really wierd, and i dont understand how it works...(it is a drop down box)

<tr bgcolor="#F4F6FF">
                  <td><font class="ftsms_font">Country:</font></td>
                  <td><select name="countrycode" class="ftsms_pulldownmenu">
                    <OPTION>12345678901234567890</OPTION>
                    <OPTION></OPTION>
                    <OPTION></OPTION>
                    <OPTION></OPTION>
                    <OPTION></OPTION>
                    <OPTION></OPTION>
                  </select></td>
                </tr>

The three values for the drop down box are

Please Select

United Kingdom

Austrailia

In that order, but there is no name for any of them in the html....how can this be?? and how could i choose "United Kingdom" from it....

$MsgForm = _IEFormGetCollection ($oIE,0)

$MsgCountry = _IEFormElementGetObjByName ($MsgForm, "countrycode")

_IEFormElementOptionselect ($MsgCountry, "United Kingdom", 1, "byText")

this doesnt work...any ideas??


Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try setting this and see if it works:

$MsgForm = _IEFormGetCollection ($oIE,0)

$MsgCountry = _IEFormElementGetObjByName ($MsgForm, "countrycode")

MsgBox(0, "", "Set Box to United Kingdom")
$value = _IEFormElementGetValue ($MsgCountry)
MsgBox(0, "", "Set Box to something other than United Kingdom")
_IEFormElementOptionselect ($MsgCountry, $value, 1, "byValue")

Kenny

Edited by ken82m

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Share this post


Link to post
Share on other sites

Ha, oh man, thank you VERY much ken for your reply, but i have just realised i have done something really stupid, right down at the bottom i had:

_IEFormElementSetValue ($MsgCountry, "")

Which must have been left right when i first started writing this script and so it was selecting United Kingdom all this time...it was just wiping that selection straight after...man, if i just paid more attention i would have my coding done in half the time!

second help of the evening ken, thanks again!


Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ahhh, yeah that would do it lol.

That's usually me, I'll have these crazy problems that I think are complicated.

And then find out it's some stupid problem where I had some tray line or left out a quote

No problem, have fun :)

Kenny

Edited by ken82m

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Share this post


Link to post
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
Sign in to follow this  
Followers 0