R
R. Rajesh Jeba Anbiah
I have Googled a lot, but couldn't still find the answer...
I could see, I can trigger the "click" event like:
button_object.Click()
But, I need to trigger the onChange() of select options. I couldn't
find anything like:
select_object.Change()
More specifically, I have something like:
<select name="sel" onChange="alert(this.selectedIndex)">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
and I have something in JS like:
form1.sel.selectedIndex = 2; //changing
If I change the index, it doesn't trigger the onChange event. I
wish to trigger the change event. Is there anyway to go with
JavaScript or JScript? TIA.
I could see, I can trigger the "click" event like:
button_object.Click()
But, I need to trigger the onChange() of select options. I couldn't
find anything like:
select_object.Change()
More specifically, I have something like:
<select name="sel" onChange="alert(this.selectedIndex)">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
and I have something in JS like:
form1.sel.selectedIndex = 2; //changing
If I change the index, it doesn't trigger the onChange event. I
wish to trigger the change event. Is there anyway to go with
JavaScript or JScript? TIA.