Results 1 to 6 of 6

Thread: Simulating a dropdown event for a select object in html.

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    7

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Simulating a dropdown event for a select object in html.

    Moved from COM & ActiveX

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    7

    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    7

    Re: Simulating a dropdown event for a select object in html.

    Yeah, the fireevent method works.
    Thanks a lot.

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Simulating a dropdown event for a select object in html.

    Excellent. Add [Resolved] to the thread title.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width