JavascriptToolbox.com Now Available!

Almost all of my javascript code has been moved over to its new home at The Javascript Toolbox. Please go there to find the latest scripts, information, etc. These pages will remain here for a while for historical purposes in case anyone needs a production copy of old code.
Selectbox Functions
[Javascript Toolbox]  [Example]  [Source]
Description:
These functions allowed you to do commonly-requested actions with select boxes.

For example, you can easily pass values between two select boxes. This makes a nice Windows-style interface for choosing components, adding and removing items from a list, etc. Options are re-ordered as they are added and removed from the lists.

Several other functions are included in the source that are not in the examples. This includes copying items in lists instead of moving them, copying/moving all items, and automatically selecting all items in a list.

NOTE!!!: If you are looking for a way to make dynamic select boxes, see Dynamic Option List. If you just want to have a "move options between list boxes" interface, use the Option Transfer library which extends these functions and makes the job easier.



Example:

Moving Values Between Select Boxes
(In IE, you can double-click the options!)






Do not allow moving of options matching pattern:


Moving Values Between Select Boxes WITHOUT auto-sort
>>

All >>

<<

All <<


Moving Options up and down




Copying Values From One Select Box To Another
>>

All >>


Remove Selected Options


Selecting options by regular expression
Select Matching Options:
Select ONLY Matching Options:
Un-Select Matching Options: