function fillCategory(){ // this function is used to fill the category list on load addOption(document.product_form.producent, "3", ".", ""); addOption(document.product_form.producent, "1", "LENIAR", ""); addOption(document.product_form.producent, "5", "OLFA", ""); addOption(document.product_form.producent, "2", "STANDARDGRAPH", ""); addOption(document.product_form.producent, "4", "WEDO", "");} function SelectSubCat(){ // ON selection of category this function will work removeAllOptions(document.product_form.seria); } ////////////////// 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); }