Double Click in Selection Box to bring up popup

I have 2 selection boxes: 1 with a list of employees and 1 with a list of selected employees. Using arrows you can move an empoyee from the Available List to the Selected List. This works great and makes it very clear for our clients. Now I would like to add the following functionality:

I would like to create it in a way that people can double-click on the name of the employee in the Selected Employee box and that double-clicking on that name will bring up a popup with that employee's profile. I am guess something like this but just do not know how to write it in JScript:

{"profile.asp?EMP_ID=" + document.formname.SelectedEmployee,SelectedItem.value);

<SELECT NAME="SelectedEmployee" OnDoubleClick="javascript:PopUpProfile()">

Is this possible and if so, how?
Who is Participating?
ZvonkoSystems architectCommented:
Like this:

function PopUpProfile(theSel){"profile.asp?EMP_ID=" + theSel.value, "profile", "top=100,left=100,height=400,width=300");
<SELECT NAME="SelectedEmployee" MULTIPLE onDblClick="PopUpProfile(this)">

pgkooijmanAuthor Commented:
Hi ZVonko, I am afraid everything works but it is not getting any value for EMP_ID. theSel.value is undefined. Any way to fix that problem?
try this:"profile.asp?EMP_ID=" + theSel.options[thieSel.selectedIndex].value, "profile", "top=100,left=100,height=400,width=300");

normally when using the multiple attribute in select-elements you have to use a loop to check which options are selected. but you are using a doubleclick so when you first click a option it becomes selected the second time the ondblclick-event is fired.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ZvonkoSystems architectCommented:
Moin' Alex :-)

@pgkooijman: are you talking about my upper example or about yout version?
Any code can have typos, also mine ;-)

pgkooijmanAuthor Commented:
Whoopsie, my error. It works, thanks, points given!
ZvonkoSystems architectCommented:
No problem.
Thanks for points.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.