Forum Moderators: open
<click> (back button. :-) )
I've had some problems with too MANY option lists on a page though. It literally choked up MSIE, oddly enough I was able to get around this by removing all white space. Will be a real bugger for anyone to edit though!
<script type="text/javascript">
document.write("<select>");
for(i = 1; i <= 20000; i++) {
document.write("<option>#" + i + " ");
}
document.write("</select>");
</script>
For example:
List thousands of cities in a single drop down
VS
List of states in one drop down, when one is selected populate the cities of that state in the drop down below it.
I see what you mean.
Yes I do that in some other scenarios.
In my scenario, the select box shows some 10 lines at a time and allows multiple select.
It's easy and works fine to use the scrolling bar.
I need the multiple select possibility (across parent/child eg venti's city5 from state2 and city4 from state9), so I think the single dropdownbox is the best way to go.
But if there were to be a limit, I agree at first impulse it would be the appropriate alternative to break it down into parent child pieces but I'd have to think hard how I could maintain that crossed multiple select ability of my example.
One option would be.. -assuming your admin guys know the potential options- to use a script that replicates itself combined with an AJAX suggest box:
The form loads. And empty text field where you now have the dropdown. The user types the first 2 letters of the option (s)he wants. Ajax jumps in, and generates a list of 10 (50, 100,...) options available in the database. Upon selecting an option, a javascript jumps in, and places a new empty text box with ajax func. below the filled text field. etcetc untill all options are selected.
Big benefit: Loading time decreases enourmously, I think. Big downside: You will have to build some new processing & create some ajax calls. Luckily for you: You seem to have control over the users & the technology they have on their machines.
I realize you do not have a problem. Just curious to hear why you have so many options. Nozy, I guess..
As for the technique: I use it for a seasonal cooking website I run; and users want to insert ingredients. It avoids long search lists, allow for new ingredients to be entered and reduces duplicates enormously.