function fillCategory(){ // this function is used to fill the category list on load addOption(document.drop_list.location, "2", "Valley Forge Beef & Ale (Audubon) 9:00pm", ""); } function SelectSubCat(){ // ON selection of category this function will work removeAllOptions(document.drop_list.SubCat); addOption(document.drop_list.SubCat, "showdate", "Select Date", ""); if(document.drop_list.location.value == '2'){ addOption(document.drop_list.SubCat,"2010-09-11", "September 11"); addOption(document.drop_list.SubCat,"2010-09-25", "September 25"); addOption(document.drop_list.SubCat,"2010-10-09", "October 9"); addOption(document.drop_list.SubCat,"2010-10-16", "October 16"); addOption(document.drop_list.SubCat,"2010-10-23", "October 23"); addOption(document.drop_list.SubCat,"2010-10-30", "October 30"); addOption(document.drop_list.SubCat,"2010-11-20", "November 20"); } if(document.drop_list.location.value == '3'){ } } ////////////////// function removeAllOptions(selectbox) { var i; for(i=selectbox.options.length-1;i>=0;i--) { //selectbox.options.remove(i); selectbox.remove(i); } } function addOption(selectbox, value, text ) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; selectbox.options.add(optn); }