[thelist] dynamically populating <SELECT> when selected

Christian Heilmann codepo8 at gmail.com
Thu Dec 15 16:57:09 CST 2005


> I have been trying to accomplish a small feat with the standard SELECT input.
> My problem is that our application loads very large set of data for each select input.
> All of this data is loaded from a database query, and all of these queries happen each
> time the page is loaded.
> Since users of this application only occasionally select some of these inputs, my idea
> is to only populate the options for the select list when the select box or select arrow
> is clicked.  An onClick type javascript function would then load the option elements
> interactively.

Please do not populate the dropdown when users select it. We do this
on our timesheet system and there is nothing more annoying, especially
as it resets some other values you entered while waiting for the
loading. Furthermore, it doesn't work with a keyboard, and that is how
most people do use forms.

Why not add a "show options" link and replace it with the dropdown
once it is clicked. You can use an AJAX layer to populate the dropdown
on the server and replace the link on the return.

This is dead easy to achieve via XAJAX: http://xajax.sourceforge.net/

--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/



More information about the thelist mailing list