Page 1 of 1

Select option in list but no answer from webpage

Posted: 25 May 2014, 16:27
by brix
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

Re: Select option in list but no answer from webpage

Posted: 26 May 2014, 01:29
by Menixator

Code: Select all

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

Re: Select option in list but no answer from webpage

Posted: 27 May 2014, 06:38
by Guest
[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]

:/

Re: Select option in list but no answer from webpage

Posted: 27 May 2014, 06:38
by brix
Oups i forgot to log.

Re: Select option in list but no answer from webpage

Posted: 29 May 2014, 02:11
by Menixator
try clicking it after selecting:

Code: Select all

wb.document.all.Years.click()

Re: Select option in list but no answer from webpage

Posted: 29 May 2014, 02:45
by jethrow
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")

Re: Select option in list but no answer from webpage

Posted: 03 Jun 2014, 18:06
by brix
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