ondblclick event on an option object won't work in IE

Posted on 2005-04-07
Medium Priority
Last Modified: 2009-03-04
Probably easy, but driving me nuts.  I have a select box.  All I want is to have a different ondblclick event for each option.  Here is a section of the select list

<option value="Accuracy" ondblclick="alert(\'Booyah\');">Accuracy</option>
<option value="Adapter" ondblclick="alert(\'Booyah\');">Adapter</option>
<option value="ADC output" ondblclick="alert(\'Booyah\');">ADC output</option>

Works in Firefox.  when I double click the an option it pops up a booyah.  IE nothing.  Frustrating.
Question by:JBarg
  • 2
LVL 53

Expert Comment

ID: 13731332
IE does not support any events on the option element.

LVL 49

Accepted Solution

Roonaan earned 375 total points
ID: 13731390
I tested with the code below, although I am not certain offcourse if this is compatible with your intended use of the event:

<span ondblclick="alert('Booyah');"><option value="Accuracy" />Accuracy</option></span>

LVL 49

Expert Comment

ID: 13731614
Although tnx to have helped so far; the B indicates that you still have some unclearities on this topic. We could better handle those before closing this thread.

Expert Comment

ID: 23798282
Although I could not make this solution work  as closed, I was able to resolve the problem in a slightly different way.  
I needed to use the SELECT BOX to submit the form with the identity of my selection.
I first tried putting the onDblClick="this.form.submit();" into the <OPTION then into <SPAN as suggested here.  At last I put the onDblClick="this.form.submit();"  into the <SELECT statement where it worked perfectly.  When I double click on an option it both selects that option and submits the form.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question