Jump to content
Sign in to follow this  

IE Combobox selection

Recommended Posts

I need help. I am self-taught and don't have any formal training in programming. I am trying to select an entry from a dropdown list in IE but I don't know how to do it. Below is the result from inspecting the drop down element using Chrome. 

<input name="ctl00$ContentPlaceHolder1$ddlContracts" type="text" class="rcbInput" id="ctl00_ContentPlaceHolder1_ddlContracts_Input" value="Accenture" readonly="readonly" autocomplete="off">

How do I use _IEFormElementOptionSelect and what is a "form"?

I apologize for this newbie question. Your help is much appreciated.

Share this post

Link to post
Share on other sites

An HTML form is a section of a document containing normal content, markup, special elements called controls (checkboxes, radio buttons, menus, etc.), and labels on those controls.

Here is an example using _IEFormElementOptionSelect() taken right from the helpfile :

; Open a browser with the form example, get reference to form, get reference
; to select element, cycle 10 times selecting options byValue, byText and byIndex

#include <IE.au3>

Local $oIE = _IE_Example("form")
Local $oForm = _IEFormGetObjByName($oIE, "ExampleForm")
Local $oSelect = _IEFormElementGetObjByName($oForm, "selectExample")
_IEAction($oSelect, "focus")
For $i = 1 To 10
    _IEFormElementOptionSelect($oSelect, "Freepage", 1, "byText")
    _IEFormElementOptionSelect($oSelect, "midipage.html", 1, "byValue")
    _IEFormElementOptionSelect($oSelect, 0, 1, "byIndex")


Snips & Scripts

My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ


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  

  • Create New...