• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

HTML Drop Down List with Multiple Selections

I am trying to create a drop down list that will allow to select more than one option.

Using the code below creates a list but that can only be scrolled down with the arrow keys and it not obvious if you don't know. Also I need the selected values to be return as follows

<select size="1" name="Test" multiple>


and not


Is there any easy way of accomplishing this without using complex code from ASP or Java?
1 Solution
Chris StanyonCommented:
You can only have the dropdown if you don't set it to multiple. If you set it to multiple, then the dropdown disappear and you box will be a set number of rows deep. The reason you can only use the arrows is because you have the size set to 1.

Also, to return all the selected values you need to name your <select> as an array. You can then loop through the selected items in your handler script.

<select size="3" name="Test[]" multiple>

Open in new window


Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now