This script is a starting place for what I'd like to do, which is to use a drop down to select a 'state', which in turn populates a second drop down with 'names' of representatives from that state, which in turn when a name is selected populates several fields on the page. I'd prefer to pull the data from a google spreadsheet instead of placing it all in the javascript. This is just sample data from a script I found online, where 'apple' could be a 'state' and "red" could potentially be names to populate the second drop down, and 'groups' could be one of several additional fields to be populated.

Any help is appreciated. You can see what I'm trying to do at http://www.congressionaldebtclock.co...-contribution/ with the spreadsheet being: https://docs.google.com/spreadsheet/...5UTVCdUE#gid=0

var colors = { apple: "red",
grape: "purple",
milk: "white",
cheese: "yellow",
chicken: "white",
beef: "red" };

// do same thing with this one perhaps:
var groups = new Array();
groups["apple"] = "fruit";
groups["grape"] = "fruit";
groups["milk"] = "diary";
groups["cheese"] = "diary";
groups["chicken"] = "meat";
groups["beef"] = "meat";

function printColorAndGroup(select){
var text = select.options[select.selectedIndex].value;
document.getElementById('group').value = groups[text];
document.getElementById('color').value = colors[text];
}