Adding Options
General
Add or change options on a form select menu. Simple script, includes comments.
Notes
- Created by: Rick Johnson
- Web Site: http://www.vistaviews.net/
- Posted: August 3, 2005
Source Code
Paste this source code into the designated areas.
External file
Paste this code into an external JavaScript file named: addingOptions.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)While the general idea is there this code is sloppy because it fails to remove blank entries, but instead only makes them blank. The script should start by clearing all entries (length=0) before writing new ones.
The code is easy to understand, but I would want to add deleting option part to the code. If someone choose 'all choices' and then choose '1&2', the code will still leave '3&4' in it. It could be easily edited by setting those unused options to null.
My mom is trying to do something similar.She is trying to make it so you chose something from one dropdown menu, it will change the options in another. I sent her the URL to this script, so she could get a little help.TG for this script.