function SelectDist(){ removeAllOptions(document.foSelect.districtID); removeAllOptions(document.foSelect.page); // addOption(document.foSelect.districtID, "", "Select district", ""); // added below switch(document.foSelect.year.value) { case '1841': addOption(document.foSelect.districtID,"1","All 1841"); break; case '1851': addOption(document.foSelect.districtID,"2","All 1851"); break; case '1861': addOption(document.foSelect.districtID,"3","All 1861"); addOption(document.foSelect.districtID,"15","Extra 1861"); break; case '1871': addOption(document.foSelect.districtID,"4","All 1871"); break; case '1881': addOption(document.foSelect.districtID,"5","All 1881"); break; case '1891': addOption(document.foSelect.districtID,"6","All 1891"); break; case '1901': addOption(document.foSelect.districtID,"7","All 1901"); break; case '1911': addOption(document.foSelect.districtID,"8","All 1911"); addOption(document.foSelect.districtID,"9","Extra 1911"); break; } // end of JS switch } // end of JS function SelectDist() function SelectPage(){ removeAllOptions(document.foSelect.page); switch(document.foSelect.districtID.value) { case '16': break; case '8': addOption(document.foSelect.page,"1","1"); addOption(document.foSelect.page,"2","2"); addOption(document.foSelect.page,"3","3"); addOption(document.foSelect.page,"4","4"); addOption(document.foSelect.page,"5","5"); addOption(document.foSelect.page,"6","6"); addOption(document.foSelect.page,"7","7"); addOption(document.foSelect.page,"8","8"); addOption(document.foSelect.page,"9","9"); addOption(document.foSelect.page,"10","10"); addOption(document.foSelect.page,"11","11"); addOption(document.foSelect.page,"12","12"); addOption(document.foSelect.page,"13","13"); addOption(document.foSelect.page,"14","14"); addOption(document.foSelect.page,"15","15"); addOption(document.foSelect.page,"16","16"); addOption(document.foSelect.page,"17","17"); addOption(document.foSelect.page,"18","18"); addOption(document.foSelect.page,"19","19"); addOption(document.foSelect.page,"20","20"); addOption(document.foSelect.page,"21","21"); addOption(document.foSelect.page,"22","22"); addOption(document.foSelect.page,"23","23"); addOption(document.foSelect.page,"24","24"); addOption(document.foSelect.page,"25","25"); addOption(document.foSelect.page,"26","26"); addOption(document.foSelect.page,"27","27"); addOption(document.foSelect.page,"28","28"); addOption(document.foSelect.page,"29","29"); addOption(document.foSelect.page,"30","30"); addOption(document.foSelect.page,"31","31"); addOption(document.foSelect.page,"33","33"); addOption(document.foSelect.page,"34","34"); addOption(document.foSelect.page,"35","35"); addOption(document.foSelect.page,"36","36"); addOption(document.foSelect.page,"37","37"); addOption(document.foSelect.page,"38","38"); addOption(document.foSelect.page,"39","39"); addOption(document.foSelect.page,"40","40"); addOption(document.foSelect.page,"41","41"); addOption(document.foSelect.page,"42","42"); addOption(document.foSelect.page,"43","43"); addOption(document.foSelect.page,"44","44"); addOption(document.foSelect.page,"45","45"); addOption(document.foSelect.page,"46","46"); addOption(document.foSelect.page,"47","47"); addOption(document.foSelect.page,"48","48"); addOption(document.foSelect.page,"49","49"); addOption(document.foSelect.page,"50","50"); addOption(document.foSelect.page,"51","51"); addOption(document.foSelect.page,"52","52"); addOption(document.foSelect.page,"53","53"); addOption(document.foSelect.page,"54","54"); addOption(document.foSelect.page,"55","55"); addOption(document.foSelect.page,"56","56"); addOption(document.foSelect.page,"57","57"); addOption(document.foSelect.page,"58","58"); addOption(document.foSelect.page,"59","59"); addOption(document.foSelect.page,"61","61"); addOption(document.foSelect.page,"62","62"); addOption(document.foSelect.page,"63","63"); addOption(document.foSelect.page,"64","64"); addOption(document.foSelect.page,"65","65"); addOption(document.foSelect.page,"66","66"); addOption(document.foSelect.page,"67","67"); addOption(document.foSelect.page,"68","68"); addOption(document.foSelect.page,"69","69"); addOption(document.foSelect.page,"70","70"); addOption(document.foSelect.page,"72","72"); addOption(document.foSelect.page,"73","73"); addOption(document.foSelect.page,"74","74"); addOption(document.foSelect.page,"75","75"); addOption(document.foSelect.page,"76","76"); addOption(document.foSelect.page,"77","77"); addOption(document.foSelect.page,"78","78"); addOption(document.foSelect.page,"79","79"); addOption(document.foSelect.page,"80","80"); addOption(document.foSelect.page,"81","81"); addOption(document.foSelect.page,"82","82"); addOption(document.foSelect.page,"83","83"); addOption(document.foSelect.page,"84","84"); addOption(document.foSelect.page,"85","85"); addOption(document.foSelect.page,"86","86"); addOption(document.foSelect.page,"87","87"); addOption(document.foSelect.page,"88","88"); addOption(document.foSelect.page,"89","89"); addOption(document.foSelect.page,"90","90"); addOption(document.foSelect.page,"91","91"); addOption(document.foSelect.page,"92","92"); addOption(document.foSelect.page,"93","93"); addOption(document.foSelect.page,"94","94"); addOption(document.foSelect.page,"95","95"); addOption(document.foSelect.page,"96","96"); addOption(document.foSelect.page,"97","97"); addOption(document.foSelect.page,"98","98"); addOption(document.foSelect.page,"99","99"); addOption(document.foSelect.page,"100","100"); addOption(document.foSelect.page,"101","101"); addOption(document.foSelect.page,"102","102"); addOption(document.foSelect.page,"103","103"); addOption(document.foSelect.page,"104","104"); addOption(document.foSelect.page,"105","105"); addOption(document.foSelect.page,"106","106"); addOption(document.foSelect.page,"107","107"); addOption(document.foSelect.page,"108","108"); addOption(document.foSelect.page,"109","109"); addOption(document.foSelect.page,"110","110"); addOption(document.foSelect.page,"111","111"); addOption(document.foSelect.page,"112","112"); addOption(document.foSelect.page,"113","113"); addOption(document.foSelect.page,"114","114"); addOption(document.foSelect.page,"115","115"); addOption(document.foSelect.page,"116","116"); addOption(document.foSelect.page,"117","117"); break; case '7': addOption(document.foSelect.page,"3","3"); addOption(document.foSelect.page,"4","4"); addOption(document.foSelect.page,"5","5"); addOption(document.foSelect.page,"6","6"); addOption(document.foSelect.page,"7","7"); addOption(document.foSelect.page,"8","8"); addOption(document.foSelect.page,"9","9"); addOption(document.foSelect.page,"10","10"); addOption(document.foSelect.page,"11","11"); addOption(document.foSelect.page,"12","12"); addOption(document.foSelect.page,"13","13"); addOption(document.foSelect.page,"14","14"); addOption(document.foSelect.page,"15","15"); addOption(document.foSelect.page,"16","16"); addOption(document.foSelect.page,"17","17"); addOption(document.foSelect.page,"18","18"); addOption(document.foSelect.page,"19","19"); addOption(document.foSelect.page,"20","20"); addOption(document.foSelect.page,"21","21"); addOption(document.foSelect.page,"22","22"); addOption(document.foSelect.page,"23","23"); break; case '6': addOption(document.foSelect.page,"1","1"); addOption(document.foSelect.page,"2","2"); addOption(document.foSelect.page,"3","3"); addOption(document.foSelect.page,"4","4"); addOption(document.foSelect.page,"5","5"); addOption(document.foSelect.page,"6","6"); addOption(document.foSelect.page,"7","7"); addOption(document.foSelect.page,"8","8"); addOption(document.foSelect.page,"9","9"); addOption(document.foSelect.page,"10","10"); addOption(document.foSelect.page,"11","11"); addOption(document.foSelect.page,"12","12"); addOption(document.foSelect.page,"13","13"); addOption(document.foSelect.page,"14","14"); addOption(document.foSelect.page,"15","15"); addOption(document.foSelect.page,"16","16"); addOption(document.foSelect.page,"17","17"); addOption(document.foSelect.page,"18","18"); addOption(document.foSelect.page,"19","19"); addOption(document.foSelect.page,"20","20"); break; case '5': addOption(document.foSelect.page,"1","1"); addOption(document.foSelect.page,"2","2"); addOption(document.foSelect.page,"3","3"); addOption(document.foSelect.page,"4","4"); addOption(document.foSelect.page,"5","5"); addOption(document.foSelect.page,"6","6"); addOption(document.foSelect.page,"7","7"); addOption(document.foSelect.page,"8","8"); addOption(document.foSelect.page,"9","9"); addOption(document.foSelect.page,"10","10"); addOption(document.foSelect.page,"11","11"); addOption(document.foSelect.page,"12","12"); addOption(document.foSelect.page,"13","13"); addOption(document.foSelect.page,"14","14"); addOption(document.foSelect.page,"15","15"); addOption(document.foSelect.page,"16","16"); addOption(document.foSelect.page,"17","17"); addOption(document.foSelect.page,"18","18"); addOption(document.foSelect.page,"19","19"); addOption(document.foSelect.page,"20","20"); addOption(document.foSelect.page,"21","21"); addOption(document.foSelect.page,"22","22"); addOption(document.foSelect.page,"23","23"); addOption(document.foSelect.page,"24","24"); break; case '4': addOption(document.foSelect.page,"1","1"); addOption(document.foSelect.page,"2","2"); addOption(document.foSelect.page,"3","3"); addOption(document.foSelect.page,"4","4"); addOption(document.foSelect.page,"5","5"); addOption(document.foSelect.page,"6","6"); addOption(document.foSelect.page,"7","7"); addOption(document.foSelect.page,"8","8"); addOption(document.foSelect.page,"9","9"); addOption(document.foSelect.page,"10","10"); addOption(document.foSelect.page,"11","11"); addOption(document.foSelect.page,"12","12"); addOption(document.foSelect.page,"13","13"); addOption(document.foSelect.page,"14","14"); addOption(document.foSelect.page,"15","15"); addOption(document.foSelect.page,"16","16"); addOption(document.foSelect.page,"17","17"); addOption(document.foSelect.page,"18","18"); addOption(document.foSelect.page,"19","19"); addOption(document.foSelect.page,"20","20"); addOption(document.foSelect.page,"21","21"); addOption(document.foSelect.page,"22","22"); addOption(document.foSelect.page,"23","23"); addOption(document.foSelect.page,"24","24"); addOption(document.foSelect.page,"25","25"); addOption(document.foSelect.page,"26","26"); addOption(document.foSelect.page,"27","27"); addOption(document.foSelect.page,"28","28"); break; case '3': addOption(document.foSelect.page,"1","1"); addOption(document.foSelect.page,"2","2"); addOption(document.foSelect.page,"3","3"); addOption(document.foSelect.page,"4","4"); addOption(document.foSelect.page,"5","5"); addOption(document.foSelect.page,"6","6"); addOption(document.foSelect.page,"7","7"); addOption(document.foSelect.page,"8","8"); addOption(document.foSelect.page,"9","9"); addOption(document.foSelect.page,"10","10"); addOption(document.foSelect.page,"11","11"); addOption(document.foSelect.page,"12","12"); addOption(document.foSelect.page,"13","13"); addOption(document.foSelect.page,"14","14"); addOption(document.foSelect.page,"15","15"); addOption(document.foSelect.page,"16","16"); addOption(document.foSelect.page,"17","17"); addOption(document.foSelect.page,"18","18"); addOption(document.foSelect.page,"19","19"); addOption(document.foSelect.page,"20","20"); addOption(document.foSelect.page,"21","21"); addOption(document.foSelect.page,"22","22"); addOption(document.foSelect.page,"23","23"); addOption(document.foSelect.page,"24","24"); addOption(document.foSelect.page,"25","25"); addOption(document.foSelect.page,"26","26"); addOption(document.foSelect.page,"27","27"); addOption(document.foSelect.page,"28","28"); break; case '2': addOption(document.foSelect.page,"2","2"); addOption(document.foSelect.page,"3","3"); addOption(document.foSelect.page,"4","4"); addOption(document.foSelect.page,"5","5"); addOption(document.foSelect.page,"6","6"); addOption(document.foSelect.page,"7","7"); addOption(document.foSelect.page,"8","8"); addOption(document.foSelect.page,"9","9"); addOption(document.foSelect.page,"10","10"); addOption(document.foSelect.page,"11","11"); addOption(document.foSelect.page,"12","12"); addOption(document.foSelect.page,"13","13"); addOption(document.foSelect.page,"14","14"); addOption(document.foSelect.page,"15","15"); addOption(document.foSelect.page,"16","16"); addOption(document.foSelect.page,"17","17"); addOption(document.foSelect.page,"18","18"); addOption(document.foSelect.page,"19","19"); addOption(document.foSelect.page,"20","20"); addOption(document.foSelect.page,"21","21"); addOption(document.foSelect.page,"22","22"); addOption(document.foSelect.page,"23","23"); addOption(document.foSelect.page,"24","24"); addOption(document.foSelect.page,"25","25"); addOption(document.foSelect.page,"26","26"); addOption(document.foSelect.page,"27","27"); addOption(document.foSelect.page,"28","28"); addOption(document.foSelect.page,"29","29"); addOption(document.foSelect.page,"30","30"); addOption(document.foSelect.page,"31","31"); addOption(document.foSelect.page,"32","32"); addOption(document.foSelect.page,"33","33"); addOption(document.foSelect.page,"34","34"); addOption(document.foSelect.page,"35","35"); addOption(document.foSelect.page,"36","36"); break; case '1': addOption(document.foSelect.page,"1","1"); addOption(document.foSelect.page,"2","2"); addOption(document.foSelect.page,"3","3"); addOption(document.foSelect.page,"4","4"); addOption(document.foSelect.page,"5","5"); addOption(document.foSelect.page,"6","6"); addOption(document.foSelect.page,"7","7"); addOption(document.foSelect.page,"8","8"); addOption(document.foSelect.page,"9","9"); addOption(document.foSelect.page,"10","10"); addOption(document.foSelect.page,"11","11"); addOption(document.foSelect.page,"12","12"); addOption(document.foSelect.page,"13","13"); addOption(document.foSelect.page,"14","14"); addOption(document.foSelect.page,"15","15"); addOption(document.foSelect.page,"16","16"); addOption(document.foSelect.page,"17","17"); addOption(document.foSelect.page,"18","18"); addOption(document.foSelect.page,"19","19"); addOption(document.foSelect.page,"20","20"); addOption(document.foSelect.page,"21","21"); addOption(document.foSelect.page,"22","22"); addOption(document.foSelect.page,"23","23"); addOption(document.foSelect.page,"24","24"); addOption(document.foSelect.page,"25","25"); addOption(document.foSelect.page,"26","26"); addOption(document.foSelect.page,"27","27"); addOption(document.foSelect.page,"28","28"); addOption(document.foSelect.page,"29","29"); break; case '9': break; case '15': break; } // end of JS switch } // end of JS function SelectPage() 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); }