TenVolt
                          Tech Notes
JavaScript > Forms articles:

 • How do I have the list of OPTIONs in a SELECT listbox change depending on the selection in another listbox?
  How do I scroll a SELECT MULTIPLE input / listbox so that the SELECTED OPTION is visible?  Read
  How do use buttons to insert text (e.g. HTML tags) into a TEXTAREA at the cursor position?  Read
  Solving the "form elements show through pop-up menu layer" problem  Read

Return to index of articles

How do I have the list of OPTIONs in a SELECT listbox change depending on the selection in another listbox?

Category: JavaScript
Category: Forms

Background

This is a common problem, e.g. you have one listbox which selects the country then you have a second which should only display the valid states/province for that country, or one listbox which shows categories and another which lists the subcategories for that category, etc...

<script src="http://mike.kingery.com/inc/js/filterSelect.js"></script> <script language="JavaScript"> auto_enable_disable = true; </script> <form> <select name="dropDownBox1" onchange="filterSelect(dropDownBox2,this)"> <option value="Choice1">Choice 1 <option value="Choice2">Choice 2 <option value="Choice3">Choice 3 <option value="Choice4">Choice 4 </select> <select name="dropDownBox2"> </select> </form>

9/16/2003

Source: Visit

 TuneVault
 Music & MP3's
 10v Calendar
 Online & Easy
 Craigger
 Various & Misc.
 RetroVault
 Toys Toys Toys!
   

All contents ©2003 Ten Volt Consulting. All rights reserved.
Unauthorized duplication or use is a violation of applicable laws.
Webmaster Contact