Forum Moderators: open
Using size='5' is no good as it now a scroll bar drop down rather than something that opens fully and allows you to multi select.
How else do you do this?
Using size='5' is no good as it now a scroll bar drop down rather than something that opens fully and allows you to multi select.
Simply setting the size attribute to something > 1 should produce a fixed size list box of that many lines; not a drop down. However, it may depend on what browser you are using, as the W3C states [w3.org]:
size = number
If a SELECT element is presented as a scrolled list box, this attribute specifies the number of rows in the list that should be visible at the same time. Visual user agents are not required to present a SELECT element as a list box; they may use any other mechanism, such as a drop-down menu.
Although IE, FF and Opera should produce a fixed sized list box. Can you post a code fragment?
<td><b>Legal Entity:<i> Hold down CTRL to multi-select</i></b><br /><select id = 'LE' name = 'LE' style='width:200px;' multiple size='5'>
<option>--- Legal Entity ---</option>
<option value='0' selected>Select All</option>
<?
mssql_data_seek($resultLE,0);
while ($rowLE=mssql_fetch_assoc($resultLE))
{
echo "<option value='".$rowLE['CompanyCode']."'>(".$rowLE['CompanyCode'].") ".$rowLE['CompanyDescription']."</option>";
}
?>
</select></td>
<td><b>Legal Entity:<i> Hold down CTRL to multi-select</i></b><br /><select id = 'LE' name = 'LE' style='width:200px;' multiple size='5'>
<option>--- Legal Entity ---</option>
<option value='0' selected>Select All</option>
<option value='12'>(12) Comp Ltd</option>
<option value='20'>(20) Comp Consultancy Ltd</option>
<option value='44'>(44) Comp Structures</option>
<option value='45'>(45) A Ltd</option>
<option value='49'>(49) B Partnership</option>
<option value='73'>(73) Comp (CI) Ltd</option>
<option value='2002'>(2002) A Group (Malta) Ltd</option>
<option value='3051'>(3051) A NA Inc</option>
<option value='3151'>(3151) A Engineering Malaysia</option>
<option value='3152'>(3152) A </option>
<option value='3201'>(3201) A</option>
<option value='3251'>(3251) Project Management</option>
<option value='3271'>(3271) Korea</option></select></td>
I'm not aware of any CSS that could effect this, or HTML for that matter. Do you have any JavaScript that might alter your SELECT element?