Select option in list but no answer from webpage

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
brix
Posts: 14
Joined: 20 Feb 2014, 09:35

Select option in list but no answer from webpage

25 May 2014, 16:27

Hi,
I have this code

Code: Select all

 <select name="Years" class="list" onchange="showSaison(this.value)" abp="551">
 <option value="" abp="552">In wich year are you ?</option>
  <option value="1" abp="553">1sr year</option>
  <option value="2" abp="554">2nd year</option>
  <option value="3" abp="555">3d year</option>
  <option value="4" abp="556">4th year</option>
  <option value="5" abp="557">5th year</option>
 											
 </select>
So to select an option i do

Code: Select all

wb.document.all.Years.value := "1"
It works, in the list "1st year" appears, but the webpage doesn't react the same as when i do a manual mouseclick.
I tryed some other thing but nothing works.

Can someone help me, it been 3days i'm into this...

regards
User avatar
Menixator
Posts: 69
Joined: 30 Sep 2013, 04:10

Re: Select option in list but no answer from webpage

26 May 2014, 01:29

Code: Select all

wb.document.all.Years.selectedIndex := 1
Guest

Re: Select option in list but no answer from webpage

27 May 2014, 06:38

[quote="Menixator"][code=autohotkey]wb.document.all.Years.selectedIndex := 1[/code][/quote]

Hi,
I already tryed that. It as the same behaviour as

[code]wb.document.all.Years.value := "1"[/code]

:/
User avatar
Menixator
Posts: 69
Joined: 30 Sep 2013, 04:10

Re: Select option in list but no answer from webpage

29 May 2014, 02:11

try clicking it after selecting:

Code: Select all

wb.document.all.Years.click()
User avatar
jethrow
Posts: 188
Joined: 30 Sep 2013, 19:52
Location: Iowa

Re: Select option in list but no answer from webpage

29 May 2014, 02:45

Check out the onchange event in your html. This will not be triggered by simply changing the value programatically - but you can make sure it fires anyways:

Code: Select all

wb.document.all.Years.fireEvent("onchange")
brix
Posts: 14
Joined: 20 Feb 2014, 09:35

Re: Select option in list but no answer from webpage

03 Jun 2014, 18:06

jethrow wrote:Check out the onchange event in your html. This will not be triggered by simply changing the value programatically - but you can make sure it fires anyways:

Code: Select all

wb.document.all.Years.fireEvent("onchange")
hey, thanks that seems to work!
Thanks you for your precious help

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: GEOVAN, Google [Bot], Spawnova and 158 guests