On a side note, I'm a bit concerned about a couple variable scope issues in these functions. In the first function he's passing locally defined variables to the onchange function. Maybe that's not a problem and I'm just being thrown off by the fact that the variables have the same names as the arguments in the function's definition. Either way something smells a little funny. I'm suspicious that there might be problems if there were two of these on a page.
Sunday, June 05, 2005
bobbyvandersluis.com | Unobtrusive dynamic select boxes
One concern that has come about these related dropdown interfaces is that, since both dropdown appear when the page loads, who is to say that the user fills them out in order? And if they try to select the second one before the first they will be disappointed by an empty dropdown. One solution would be to initially hide the second menu. Another would be to leave the default code alone (with a fully populated dependant menu) when the page loads. The second option would require a little error catching in case the user's first menu selection eliminates their second one.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment