Sign in to follow this  
Followers 0
bobbo85

Set value of a combobox on a webpage

2 posts in this topic

There is a combobox on a webpage i want to manipulate. I have a combobox in my GUI that allows users to pick the priority of something, then I found the values in the html that go with the text options.

$jobpriority = GUICtrlCreateCombo("Hot", 104, 360, 145, 25,$CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "LukeWarm|Cold")

$hotcold=guictrlread($jobpriority)
Switch $hotcold
    case "Hot"
        $hotcold="2"
    case "Lukewarm"
        $hotcold="3"
EndSwitch

dim $oIE=_IECreate ("")
dim $o_form = _IEFormGetCollection ($oIE, 0)

dim $o_hotcold=_IEFormElementGetObjByName($o_form,"cboPriority") 
_IEFormElementSetValue($o_hotcold,$hotcold)

I tested the guictrlread, it gets the string right, and the switch also works, gets me the right number value... i just must be doing something wrong when setting the value of a combobox on a webpage.

Share this post


Link to post
Share on other sites



Nevermind everyone! I accidentally (via copy and paste to save time typing code) set the value to something that didn't work. Problem solved!

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