Jump to content

Selecting value from drop-down box IE


furrycow
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

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

Link to comment
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
Link to comment
Share on other sites

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

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

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