Dependent Dropdowns (getOptions function)
Use this to populate any dependent dropdown using previously created arrays of option values
// AUTHOR: Kyle McNamara (email: mac@kwm.tm)
// DATE: 09/10/2002
// DESCRIPTION: Use this to populate any dependent dropdown using
// previously created arrays of option values
// ARGUMENTS:
// -group_id = this.options.selectedIndex
// -dropdown = document.form_name.element_name
// -group_name = name of the array storing the values to use 			
function getOptions(group_id,dropdown,group_name) {
   var theArray = eval(group_name);
   for (m=dropdown.options.length-1;m>0;m--) 
      //set .options = null to erase old options
      dropdown.options[m]=null
		
   //set select options values
   for (i=0;i<theArray[group_id].length;i++)
      dropdown.options[i]=new Option(theArray[group_id][i].value,theArray[group_id][i].text)
}
 

cover
Buy Fusebox 5 & FLiP: Master-Class ColdFusion Applications
cover
Buy Fusebox 4 & FLiP: Master-Class ColdFusion Applications
cover
Buy ColdFusion Lists, Arrays, & Structures
cover
Buy ColdFusion XML Objects

Dedicated and Shared CF Hosting