Reputation: 22370
I am trying to create a drop-down menu where all the options in the drop menu are check boxes. The motivation here is so that the user can easily select multiple options in the drop-down. Based on what they select I need to parametrize the form and make an Ajax request.
Upvotes: 1
Views: 3489
Reputation: 15695
<label>
elements make it incredibly simple to make menus like this.
<ul>
<li>
<label for="item-1">
<input type="checkbox" name="item" value="1" />
<span>Item 1</span>
</label>
</li>
<li>
<label for="item-2">
<input type="checkbox" name="item" value="2" />
<span>Item 2</span>
</label>
</li>
<li>
<label for="item-3">
<input type="checkbox" name="item" value="3" />
<span>Item 3</span>
</label>
</li>
...
</ul>
The .live() function is very useful for sending $_POST requests to the server.
Note that adding padding to your <li>
elements or margin to your <label>
will make this method less effective.
Upvotes: 0
Reputation: 13161
Try Dropdown Checklist: http://dropdown-check-list.googlecode.com/svn/trunk/doc/dropdownchecklist.html
Upvotes: 0
Reputation: 24236
You could try one of these two -
or
http://code.google.com/p/jquery-asmselect/
Upvotes: 1
Reputation: 9616
A quick google for jQuery Multiselect returned a jQuery UI plugin as the first result.
Upvotes: 0