Jump to content

Set value of a combobox on a webpage


Recommended Posts

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.

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