Forums

make drop down list a Multiselect list ?

kevinman 30 Oct, 2008
I currently have a drop down list, my code for it is:

<div  class="form_item">
	<div class="form_element cf_dropdown"><label class="cf_label">Please select the type of work you would like us to do:</label><select class="cf_inputbox" id="select_19" size="1" name="select_19">
	<option value="one">one</option>
	<option value="two">two</option>
	</select><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" width="16" border="0" height="16"></a><div  class="tooltipdiv">Type of work. :: Plese select the type of work you do.</div></div><div class="clear"> </div>
</div>



How can enable users to select more then one item, like hold ctr+click or even use check boxes inside the drop down like asp.net ? (but i'm not using asp.net :wink: ).
GreyHead 30 Oct, 2008
Hi kevinman,

You need to make a few changes to the select tag attributes:
<select class="cf_inputbox" id="select_19" size="4"  multiple="multiple" name="select_19[]">
I've increased the size to '4' so that you can see the resulting list, added the 'multiple' attribute and changed the name into an array so that it will collect all the results.

Bob
This topic is locked and no more replies can be posted.