troubleshooting Question

Fitering option with doubleclick event

Avatar of Chris Stormer
Chris Stormer asked on
JavaScriptScripting Languages
2 Comments1 Solution589 ViewsLast Modified:
I have manage to filter an select list with jscript like making copy and using regexp for filtering, this is a part for making copy

    this.optionscopy = new Array();
    if (this.selectobj && this.selectobj.options) {
      for (var i=0; i < this.selectobj.options.length; i++) {

        // Create a new Option
        this.optionscopy[i] = new Option();

        // Set the text for the Option
        this.optionscopy[i].text = selectobj.options[i].text;

        // Set the value for the Option.
        // If the value wasn't set in the original select list,
        // then use the text.
        if (selectobj.options[i].value) {
          this.optionscopy[i].value = selectobj.options[i].value;
        } else {
          this.optionscopy[i].value = selectobj.options[i].text;
        }
      }
    }
  }

this is working OK but the problem is that I'm having like ondoubleclick event on every option like:

<option ondblclick="eval(parent.location='test.php?id=5')">

and it is working until I use my filter.When I use filter and when my select component is filtered out ondoubleclick option is gone.
I have tried to add this:

this.optionscopy[i].ondblclick = selectobj.options[i].ondblclick;

but it wouldn't help.Can someone tell me can I carry this doubleclick event to copied object somehow or I must find the other way by using value of copied options?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros