HighDots Forums  

right click on selectbox

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss right click on selectbox in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Arg
 
Posts: n/a

Default right click on selectbox - 01-20-2005 , 08:05 AM






How would I make a right click on a select box get the value of the option
that is under the mouse? I have a multiselect list of user names and want
to be able to right-click on one to edit the information (add an email
address to those that do not have one) for that record without deselecting
the ones that are already selected or selecting the one that is
right-clicked.

Thanks for any help



Reply With Quote
  #2  
Old   
Arg
 
Posts: n/a

Default Re: right click on selectbox - 01-20-2005 , 08:56 AM






I should have given more...

This is on a multiple select box which will have more names than are visible
in the box (it will have to be able to scroll). This is also for Internet
Explorer as it will be on a company intranet.

<script language="JavaScript">
function selMe(x){
// determine if it is a right-click
// determine the value of the option under the mouse pointer
// I'll take it from there
}
</script>

<select id=mySel1 size=5 onMouseDown="selMe('mySel');" multiple>
<option value=1>Name 1</option>
<option value=2>Name 2</option>
<option value=3>Name 3</option>
<option value=4>Name 4</option>
<option value=5>Name 5</option>
<option value=6>Name 6</option>
<option value=7>Name 7</option>
<option value=8>Name 8</option>
<option value=9>Name 9</option>
</select>

"Arg" <r_arg (AT) hotmail (DOT) com> wrote

Quote:
How would I make a right click on a select box get the value of the option
that is under the mouse? I have a multiselect list of user names and want
to be able to right-click on one to edit the information (add an email
address to those that do not have one) for that record without deselecting
the ones that are already selected or selecting the one that is
right-clicked.

Thanks for any help





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.