Jump to content

Behavior of select/option element set to multiple?


jekillen

Recommended Posts

This is something that I have not worked with in the past, though I have often worked with select/option elements in

the past.

 

When I set the type attribute to multiple, I have to shift/click to select more than one item. Then I cannot deselect

just one item. Am I doing something wrong, or is this typical behavior. The initial development is being done in

FIrefox in Mac OSX.

 

I am developing an application where a user can select items from a different list. The select/option element is

added to as the user selects items from the list. The select/option element is to allow the user to remove a selection

from the list if he/she changes their mind about a selection and wants to remove it.

 

So:

the user selects from a group of items in other elements

the item is added to a display of selected items

It is also added to the select/option list for potential removal.

 

Allowing multiple selections from this would allow the user to remove multiple selections.

 

With XHTML transitional doctype:

<select id="remove" name="remove" size="5" multiple="multiple">

<option id="default" value="">Remove:</option>

<!-- options are added here by javascript as user makes selections elsewhere -->

</select>

 

It is much easier to add/remove options one at a time. I can remove options with an onchange event listener

assigned to the select/option element.

 

Thanks for time and attention;

JK

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...