Simulating a dropdown event for a select object in html.
Not sure if this is the right forum.
I want to Simulating a dropdown event for a select object in html.
First I thought something like this could do,
For j = 0 To mtag.Options.length - 1
If InStr(1, mtag.Options(j).innerText, "XXXX") > 0 Then
mtag.Item(j).Selected = True
Exit For
End If
Next j
It turns out a dropdown event never happen although the item in the select object is selected.
Anyone have an idea how to do this?
Thanks in advance
Re: Simulating a dropdown event for a select object in html.
Re: Simulating a dropdown event for a select object in html.
After selecting the item using .Selected, call the .onChange() method of the dropdown list.
Re: Simulating a dropdown event for a select object in html.
Quote:
Originally Posted by mendhak
After selecting the item using .Selected, call the .onChange() method of the dropdown list.
Sorry I'm a newbie into this. Isn't the onchange method controlled by the webpage client-side javascript? Or should I transferred some parameters to the client-side javascript? Or object.Fireevent(OnChange) works?
And I found that "The onchange event does not fire when the selected option of the select object is changed programatically"
Thanks
Re: Simulating a dropdown event for a select object in html.
Yeah, the fireevent method works.
Thanks a lot.
Re: Simulating a dropdown event for a select object in html.
:afrog: Excellent. Add [Resolved] to the thread title.