views:

71

answers:

3

I have a form for lawyers where they need to be able to select which states they are licensed in.

So, they need a clean way to be able to select a few states from all 50 states.

What I'm not sure is, how to handle this in HTML. Is there some possible way to have a drop down of checkboxes or something similar?

I'm using ASP.NET MVC. I'm also curious how the model binding will look on the return for something like this.

Thanks,

Simpatico

+2  A: 

You cannot put checkboxes in a dropdown unfortunately, the closest you could get is something like

<select multiple="multiple">
    <option>One</option>
    <option>Two</option>
    <option>Three</option>
</select>

but I don't think that would be too useful for 50 states.

Pharabus
Also, some users may have a hard time figuring out how to select multiple options from that type of select box.
mgroves
+3  A: 

This jQuery plugin might help.
Binding should work like for regular select with multiple selected items allowed.

Arnis L.
+1  A: 

You can consider following the approach widely adopted in desktop applications.

Put two select windows together on the form - the one for all available options, the other one for the ones the user has selected. Also put two buttons, preferably between those two windows - "Add item" and "Remove item".

Now the user will have a good overview of the current selection. A little more work but very good from the usability and smooth user experience point of view.

Developer Art
Difficult to make it functional without JavaScript though. I'd also worry about how screen readers would treat it..
David Dorward