PDA

View Full Version : 3 sperate droplists from Java file


urbanrays
11-04-2009, 01:09 PM
Could someone please help me, I have 6 seperate drop down lists on my page, they are in 3 seperate catorgories, and 3 of the dropdowns from each catergory contains a list of the counties

The first drop down list for the first county is being called from "list.js"
How do I do it so each dropdown box reads this one java, or is it a case of having "list1.js" "list2.js" this is a snipet of the java code.

function fillCategory(){
// this function is used to fill the category list on load
addOption(document.drop_list.Category, "bedfordshire", "Bedfordshire", "");
addOption(document.drop_list.Category, "berkshire", "Berkshire", "");
addOption(document.drop_list.Category, "buckinghamshire", "Buckinghamshire", "");
addOption(document.drop_list.Category, "cambridgeshire", "Cambridgeshire", "");

So basically what I want is either 1 or 3 java files each updating 3 seperate drop down lists.
I dont want to clog my html code up with 3 seperate lists of all the counties in the UK

I hope this is understandable.

Thanks in advance