I have created a multi-select list with PHP. I started out with just a single select drop down. Is there a way to have a multi-select drop down. I would prefer to have the drop down rather than a scrolled list. Here's what I've got so far:
<form action='/MaterialTracking_Filtered.php' enctype='multipart/form-data' method='post'>
<input type='hidden' name='action' value='SearchTerms' />
<table id='SearchTable'>
<tr>
<td>
<label>State</label>
<select name='State[]' multiple='multiple' size='1'>
<option value='' selected='selected'>All</option>
<option value='AL'>AL</option>
<option value='AZ'>AZ</option>
<option value='CA'>CA</option>
<option value='FL'>FL</option>
</select></td>
<td>
<label>Project</label>
<input type='text' name='Project' size='10' /></td>
</tr>
<tr>
<td>
<center>
<input type='submit' name='submit' value='Search' />
</center>
</td>
<td></td>
</tr>
</table>
</form>
Right now this gives me a scrolled select list, I want a drop list so there is no scrolling.
Here's a fiddle of what I've got: selectList
EDIT
I have tried the answer from below by @GCRDev and am not able to get it to work for me. In my fiddle it works fine like this:
Then I put it into my website and it looks like this instead:
I copied it exactly from one to the other. I've even updated the fiddle to show the update. I don't know why it's not working except maybe the way the <div>
is being displayed?