.Net, ASP.NET, DropDownList, HTML, Programming, UpdatePanel, Web Development, WebForms

How to Extend the Expanded Select List Options for Older Browsers

A Lengthening Select List
Example of a Lengthening Select List

When putting together a Web based form space can be at a premium. Select lists are typically auto-adjusted by your browser to be the length of the longest option in the list.

But that just doesn’t work when space is tight and in many of my forms one doesn’t want the select list to automatically size itself to a length beyond what has been allocated for it, especially if the options are dynamically coming from a database.

To handle this gracefully for all browsers is actually not quite as simple as it seems and requires a bit of JavaScript to work universally.

Continue reading “How to Extend the Expanded Select List Options for Older Browsers”