Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Double Click in Selection Box to bring up popup

Posted on 2004-10-26
6
Medium Priority
?
6,332 Views
Last Modified: 2012-05-05
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:

<JAVASCRIPT>
PopUpProfile()
{
window.open("profile.asp?EMP_ID=" + document.formname.SelectedEmployee,SelectedItem.value);
}
</JAVASCRIPT>

<SELECT NAME="SelectedEmployee" OnDoubleClick="javascript:PopUpProfile()">
<OPTION VALUE="EMP_ID">Employee Name</OPTION>
</SELECT>

Is this possible and if so, how?
0
Comment
Question by:pgkooijman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 2000 total points
ID: 12418752
Like this:

<html>
<head>
<SCRIPT>
function PopUpProfile(theSel){
  window.open("profile.asp?EMP_ID=" + theSel.value, "profile", "top=100,left=100,height=400,width=300");
}
</SCRIPT>
</head>
<body>
<form>
<SELECT NAME="SelectedEmployee" MULTIPLE onDblClick="PopUpProfile(this)">
<OPTION VALUE="EMP_ID1">Employee Name1</OPTION>
<OPTION VALUE="EMP_ID2">Employee Name2</OPTION>
<OPTION VALUE="EMP_ID3">Employee Name3</OPTION>
</SELECT>
</form>
</body>
</html>


0
 

Author Comment

by:pgkooijman
ID: 12419165
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?
0
 
LVL 3

Expert Comment

by:ragerino
ID: 12419328
try this:
window.open("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.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 63

Expert Comment

by:Zvonko
ID: 12419429
Moin' Alex :-)

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

0
 

Author Comment

by:pgkooijman
ID: 12419512
Whoopsie, my error. It works, thanks, points given!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12419550
No problem.
Thanks for points.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

636 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