Select Box with Options | JavaScriptSource

Select Box with Options

Krijn Hoetmer Nov 10, 2006

General

Use this script to easily change the order of options in a select box. You can see the order change as it happens in the "New Order" box. (The input can be hidden and used to change the order on the server side.)


Options:
Order:

New order:
(This input can be hidden and used to change the order server side)

Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: selectBoxOptions.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(8 comments)

You might re-check your script. It works fine for me using Firefox 2.0.0.14.

Lee Jun 26, 2008

It works fine for me in Firefox. If you need additional help, you'll need to post your question [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]over on the forums[/a].

Lee Jun 26, 2008

The code works excellent for IE, but not for Mozilla Firebfox. Anyone knows why?

Tony Mar 28, 2008

This is very simple script and it does not work when there are more elements then user can see at the same time (there is vertical scrall bar). In FF it does not scrall down to the selected element, it just selectes it but scralls list box to the top :(

Delphi Jan 16, 2008

the code is very nice and useful

surya Jan 29, 2007