I have a drop-down menu as following:
<select onchange="random_function()" id='choice' >
<option selected="selected" >
Make a choice
</option>
</select>
I populate it through a php request inside the <select>
tag as following:
<?php
include 'config.php';
$query = $pdo->query('
SELECT choices
FROM allTheChoices'
);
while ($row = $query->fetch()){
echo "<option>".$row['choices']."</option>";
}
?>
For the moment, my database is uncomplete and I have only 2 options to display but there will be plenty in the future (100+).
My goal is to find a way to let the select only show 10 options and it should display a scroll bar to see all the remaining options.
I already tried using <select size="10">
but the design of the dropdown is completely changed and awful.
Do you have a simple way to do this without altering the design?