function SelectBook(){ removeAllOptions(document.foSelect.bookID); addOption(document.foSelect.bookID, "0", "Select book", ""); switch(document.foSelect.groupID.value) { case '6': break; case '7': break; case '2': addOption(document.foSelect.bookID,"38",""); addOption(document.foSelect.bookID,"2","Feoffee accounts"); break; case '1': addOption(document.foSelect.bookID,"1","D. of Kingston accts1722"); addOption(document.foSelect.bookID,"3","D. of Kingston accts 1725"); addOption(document.foSelect.bookID,"4","D. of Kingston accts 1733"); addOption(document.foSelect.bookID,"5","D. of Kingston accts 1735"); addOption(document.foSelect.bookID,"6","D. of Kingston accts 1736"); addOption(document.foSelect.bookID,"7","D. of Kingston accts 1737"); addOption(document.foSelect.bookID,"9","D. of Kingston accts 1738"); addOption(document.foSelect.bookID,"12","D. of Kingston accts 1739"); addOption(document.foSelect.bookID,"13","D. of Kingston accts 1740"); addOption(document.foSelect.bookID,"14","D. of Kingston accts 1741"); addOption(document.foSelect.bookID,"16","D. of Kingston accts 1742"); addOption(document.foSelect.bookID,"18","D. of Kingston accts 1743"); addOption(document.foSelect.bookID,"20","D. of Kingston accts 1746"); addOption(document.foSelect.bookID,"23","D. of Kingston accts 1748"); addOption(document.foSelect.bookID,"22","D. of Kingston accts 1747"); addOption(document.foSelect.bookID,"24","D. of Kingston accts 1749"); addOption(document.foSelect.bookID,"25","D. of Kingston accts 1750"); addOption(document.foSelect.bookID,"26","D. of Kingston accts 1751"); addOption(document.foSelect.bookID,"27","D. of Kingston accts 1752"); addOption(document.foSelect.bookID,"28","D. of Kingston accts 1753"); addOption(document.foSelect.bookID,"29","D. of Kingston accts 1754"); addOption(document.foSelect.bookID,"31","D. of Kingston accts 1755"); addOption(document.foSelect.bookID,"32","D. of Kingston accts 1756"); addOption(document.foSelect.bookID,"33","D. of Kingston accts 1757"); addOption(document.foSelect.bookID,"34","D. of Kingston accts 1758"); addOption(document.foSelect.bookID,"35","D. of Kingston accts 1759"); addOption(document.foSelect.bookID,"36","D. of Kingston accts 1760"); addOption(document.foSelect.bookID,"37","D. of Kingston accts 1761"); addOption(document.foSelect.bookID,"21","D. of Kingston accts 1762"); addOption(document.foSelect.bookID,"10","D. of Kingston accts 1763"); break; } // end of JS switch } // end of JS function SelectBook() 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); }