I have 2 select dropdown lists. The 1st one contains a list of states and the 2nd one a list of counties.
Whenever I manually select any state from the 1st list the 2nd one loads the list of the corresponding counties.
Using ahk I'm able to select the option I want from the 1st dropdown but the 2nd one never loads the corresponding counties for the state i selected, probably because the javascript event never fired.
Here's part of the html for the 1st dropdown:
Code: Select all
<select class="form-control" data-bind="dropdownList: states, dropdownCaption: 'Seleccionar estado', disableCaption: true, value: stateId, event: { change: onStateChange }"><option value="" disabled="" style="display: none;">Seleccionar estado</option><option value="1">Aguascalientes</option><option value="2">Baja California</option>
Code: Select all
<select class="form-control" data-bind="dropdownList: counties, dropdownCaption: 'Seleccionar municipio/delegación', disableCaption: true, value: countyId, event: { change: onCountyChange }"><option value="" disabled="" style="display: none;">Seleccionar municipio/delegación</option></select>
Code: Select all
pwb.document.getElementsByClassName("form-control")[1].Value := "22" ; Sets state
I've tried the following to no avail:
Code: Select all
pwb.document.getElementsByClassName("form-control")[1].fireEvent("onchange")