NOTE: This post is now obsolete. Please click here to find the most recent mention of the script.
Donncha pointed this out to me. It’s an improvement over the standard multi-line select box in that you don’t need to know the magic key combination for selecting a second item without losing the first.
I didn’t like that it adds to the bulk of the source code, though! So, here is an improvement.
NOTE: Your multi-line select box’s name must end in ‘‘. While this is against some rules for HTML, it is, AFAIK the only way to make a multi-select work in any case.
update: Michel pointed out that the code only works on the first select box found. I’ve updated the code to fix this. Thanks, Michel!
update (2004-10-07): Thanks to Shaun Walbridge for spotting an intermittent NULL problem. Code has been updated to reflect that.
update (2004-11-04): Thanks to Jeff Hansen for requesting that the script support the HTML
disabled attribute. It now does.
skyinsight.net – an example of the tool being used for selection from a large list.
update (2004-12-02): Thanks to Bruno Henry of UPS France for pointing out that the script does not initialise pre-selected items correctly in IE. This was because of this bug here. The script has been corrected to reflect this.
update (2004-12-16): Thanks to Cameron for his interesting method of defining whether a select box is multiple or not. It has been incorporated.