|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Limit users to pick one selection from list box
Hello. I have two list boxes on a front-end client dashboard. The selections in the list boxes are populated using a hidden query on start-up. We need to allow users to pick one selection, and from only one listbox.
The list box names are lb_acct num and lb_group_name. So the client could make one selection in lb_acct num, but then lb_group_name must be unavailable for selection. OR the client can select one item from lb_group_name, but then lb_acct num becomes unavailable. I know there is functionality in JavaScript where you can set 'select-multiple' settings vs. 'select-one'. I would need to use the select-one functionality. Trouble is, I'm new to JS and have never used the functionality before. If anyone can offer some assistance, it is greatly appreciated!
|
|
#2
|
|||
|
|||
|
<select size="1" name="select_1">
Set each select element's onchange handler to disable the other. Or (friendlier) let the last one selected (onchange) pass it's value to a hidden field. Last one selected wins. Last edited by mrhoo; 03-05-2007 at 10:05 AM. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|