Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple select boxes

Status
Not open for further replies.

cajchris

Programmer
Oct 13, 2005
57
GB
when I am using a multiple select box it is workin ok for a single selection, but not for many selections.

Here is my code for it:

<select name="searchedDirectoryNames" id="selectedDirectories" size = "2" class="normalSelect" multiple>

<option value="About Us">About Us</option>
<option value="News">News</option>
<option value="Registrants">Registrants</option>

</select>

when i select About US, News, and Registrants in that order using the ctrl key it is being interpreted as only About Us being Selected.

even more strangely when i select News, Registrants and then About Us, it is still being interpreted as About Us. so it seems it is taking the top one only in the multiple select case.

any ideas?

thanks
cajchris
 
This is really a JavaScript question. When you re-post this question in the JavaScript forum (forum216), make sure to include the code you are using to access the selected values from the multiple-select list. This is almost certainly the location of what needs to be fixed.

--Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
When I read about it being interpreted, I suppose you're talking about the server side parsing of the variables. If you want to have multiple selections in php, the name of the box itself needs to be an array. Like so:
Code:
<select name="searchedDirectoryNames[b][][/b]" id="selectedDirectories" size = "2" class="normalSelect" multiple="multiple">
If you are using other languages, try in their respective forums.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top