From a usability point of view, if the number of options is really that long, it's difficult to find the option you actually want.
Try to find a way to split the options up into categories and perhaps show two dropdowns: the first to choose the category, and the second to show only the options within the category. You can use jQuery to dynamically create the <option>
s for the second dropdown based on the choice made in the first.
E.g
options = {
"one": [1, 2, 3, 4],
"two": [11, 12, 13, 14],
"three": [21, 22, 23, 24]
}
$("select.select1").change(function() {
var category = $(this).val() || $(this).text();
if (options[category]) {
$("select.select2").empty();
for (var i in options[category]) {
var newOption = $("<option>").text(options[category][i]);
$("select.select2").append(newOption);
}
} else {
$("select.select2").html("<option>Select a category first</option>");
}
});
$("select.select1").change();
With HTML:
<select class="select1">
<option>one</option>
<option>two</option>
<option>three</option>
</select>
<select class="select2">
<!-- I am dynamically generated -->
</select>