IE COM Dropdown select

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
euras
Posts: 429
Joined: 05 Nov 2015, 12:56

IE COM Dropdown select

17 Jan 2018, 08:42

hi, I have a problem with selecting the Item from Dropdown list. When I send a request document.getElementById("nationality2_dropdown").selectedIndex I get an answer 160 which is the Item I selected manually.
But when I try to send a command document.getElementById("nationality2_dropdown").selectedIndex := 160 to select the Item from DropDownlist, nothing hapends. value doesn't work either.
the HTML looks like in attachment. How can I select item from this Dropdownmeniu?

Code: Select all

pwb.document.getElementById("nationality2_dropdown").selectedIndex := 160
Attachments
html.png
html.png (10.22 KiB) Viewed 902 times
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: IE COM Dropdown select

17 Jan 2018, 08:50

that select element seems to not be visable as it has the display: none; style

so are you sure that this is the element that you intract with manully? and not some other element that is then setting this with js code?
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:
euras
Posts: 429
Joined: 05 Nov 2015, 12:56

Re: IE COM Dropdown select

17 Jan 2018, 08:56

Blackholyman wrote:that select element seems to not be visable as it has the display: none; style

so are you sure that this is the element that you intract with manully? and not some other element that is then setting this with js code?
well, when I select the element from DropDown, and send a command in F12 document.getElementById("nationality2_dropdown").selectedIndex I get a right answer, so it connect's somehow, the problem that I can't send a value to the Dropdown, only get the selected value...
with IWB2 learner I don't get a ID of the element when I mark it, only the TAG name. But with F12 I can see that the element has ID...
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: IE COM Dropdown select

17 Jan 2018, 09:03

then it is not the same element,

with the f12 tool try and have highlight the element that you are hovering over to see if that can help you, meny websites today use other ways of building things like dropdown to make that work or look better, but it can make it harder to work with programcally
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Rohwedder and 384 guests