Create a drop-down list with checkboxes inside it

How to create a drop-down list with checkboxes inside it using simple HTML and javascript? If this is not possible, could it be possible to fulfill this requirement with C # .net? Please help me.

+4
source share
4 answers

Try this . It turns a few items into checkboxes.

+1
source

Something like this ?

or can always use jQuery / javascript plugin like this

0
source

Create your own DropDownList.

  • C # .Net approach: This is exactly what you need. I will not copy the code as it is clearly explained in the link.
  • HTML / JS approach:

    <html> <head> <title>Scrolling Checkboxes</title> <script type="text/javascript"> </script> </head> <body> <div id="ScrollCB" style="height:150;width:200px;overflow:auto"> <Label><input type="checkbox" id="scb1" name="scb1" value="1" />First Item</Label><br /> <Label><input type="checkbox" id="scb2" name="scb2" value="2" />Second Item</Label><br /> <Label><input type="checkbox" id="scb3" name="scb3" value="3" />Third Item</Label><br /> ... </div> </body> </html> 

You can try it here: http://jsfiddle.net/aUQdW/

0
source

In the checkbox in C sharp, you should use the CheckedListBox from Windows Conntrol. Using some properties, you can get what you want. You can set Checked-Unchecked for an item in the list.

0
source

All Articles