Multi-Value Drop Down List 2 | JavaScriptSource

Multi-Value Drop Down List 2

Kiran Pai Jul 16, 2008

General

This script provides a selection in a dropdown menu, determined by the user's previous selection. Easy to implement and customize. Could be used with other dynamic languages, such as JSP or ASP. The arrays could be created by information fetched from a database.


Genre:
Guitarist:

Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: multiValueForm.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

(3 comments)

Just what I was looking for, thank you.

Paul Sep 16, 2008

Nice addition to scripting code[br /][br /]I modified it slightly to read in external JS file of data[br /]to make it easier for upkeep without changing main code.[br /][br /]Good job!

Jay Rumsey Jul 25, 2008

Thanks for the script. This is a great effect for many hierarchical choices: cities in states, divisions within companies.[br /]I think you should handle the case where the user picks the "Select One" choice after having selected "Blues" or "Rock" previously. We typically clear the second select's choices. Or you might remove the "Select One" choice after "Blues" or "Rock" is chosen.

Tom Hasert Jul 18, 2008