function fillCategory() { addOption(document.forms.opci.lok, '0', 'Nije bitno', 'SELECTED'); addOption(document.forms.opci.lok, '1', 'Cavtat', ''); addOption(document.forms.opci.lok, '3', 'Dubrovnik', ''); addOption(document.forms.opci.lok, '2', 'Dubrovnik Rivijera', ''); addOption(document.forms.opci.lok, '12', 'Elafiti islands', ''); addOption(document.forms.opci.lok, '4', 'Klek', ''); addOption(document.forms.opci.lok, '5', 'Konavle', ''); addOption(document.forms.opci.lok, '6', 'Korčula island', ''); addOption(document.forms.opci.lok, '7', 'Lastovo island', ''); addOption(document.forms.opci.lok, '8', 'Mljet island', ''); addOption(document.forms.opci.lok, '9', 'Neum', ''); addOption(document.forms.opci.lok, '10', 'Pelješac', ''); addOption(document.forms.opci.lok, '11', 'Župa Dubrovačka', ''); } function SelectSubCat(){ removeAllOptions(document.forms.opci.mje); if(document.forms.opci.lok.value == '0') { addOption(document.forms.opci.mje, '0', 'Nije bitno', 'SELECTED'); } if(document.forms.opci.lok.value == '10') { addOption(document.forms.opci.mje, '0', 'Nije bitno', 'SELECTED'); addOption(document.forms.opci.mje, '6', 'Crkvice(4)', ''); addOption(document.forms.opci.mje, '35', 'Mali Ston(2)', ''); } } 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, select ) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; optn.selected = select; selectbox.options.add(optn); } function racun() { document.forms.opci.ukupno.value = parseInt(document.forms.opci.brojlez.value) + parseInt(document.forms.opci.brojpom.value); }