или так.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<select size="1" id="selectId" onchange="change()">
<option value="rtk_uhf">UHF 35W</option>
<option value="rtk_gsm">GSM/GPRS</option>
</select>
<input type="text" name="days3" id="days3" /> <!-- ввод кол-во дней -->
<input type="button" name="button" id="button" onclick="calc_comlect()" value="вычислить">
<input type='text' id='summ' value="" /> <!-- вывод суммы на экран -->
<script type="text/javascript">
function calc_comlect() {
var days3 = document.getElementById('days3').value;// кол-во дней
var value = document.getElementById('selectId').value; // Выбираем select по id
var bablo;
if (value == "rtk_uhf") {
if (days3==0) {bablo=0;}
else if (days3<=3) { bablo=18000;}
else if (days3<=7) { bablo=days3*6000;}
else if (days3<=14) { bablo=days3*5000;}
else if (days3<=30) { bablo=days3*4500;}
else { bablo=days3*4000;}
}
else if (value == "rtk_gsm") {
if (days3==0) {value=0;}
else if (days3<=3) { bablo=16500;}
else if (days3<=7) { bablo=days3*5500;}
else if (days3<=14) { bablo=days3*4500;}
else if (days3<=30) { bablo=days3*4000;}
else { bablo=days3*3500;}
}
document.getElementById('summ').value = bablo; // сумма дни + комплект
}
</script>
</body>
</html>
|