<script type="text/javascript">
function PrintResult() {
var kitchen = document.getElementById("kitchen").options[document.getElementById("kitchen").selectedIndex].value;
var bathroom = document.getElementById("bathroom").options[document.getElementById("bathroom").selectedIndex].value;
var square = document.getElementById("square").value;
var window1 = document.getElementById("window1").value;
var window2 = document.getElementById("window2").value;
var balcon = document.getElementById("balcon").value;
var dirty = document.getElementById("dirty").options[document.getElementById("dirty").selectedIndex].value;
var maintance = (document.getElementById("maintance").checked == true) ? 1 : 0;
var chemical = (document.getElementById("chemical").checked == true) ? 100 : 0;
var KAD = (document.getElementById("KAD").checked == true) ? 200 : 0;
var price = 0;
price = parseInt(kitchen) * (300 + 100 * parseInt(dirty) + 150 * parseInt(maintance)) +
parseInt(bathroom) * (300 + 100 * parseInt(dirty) + 150 * parseInt(maintance)) +
parseFloat(square) * (16,5 + parseInt(dirty) + 15 * parseInt(maintance)) +
parseInt(window1) * (150 + 150 * parseInt(maintance)) +
parseInt(window2) * (300 + 200 * parseInt(maintance)) +
parseFloat(balcon) * (250 + 250 * parseInt(maintance)) +
parseInt(chemical) +
parseInt(KAD);
document.getElementById('result').innerHTML = price;
}
</script>
<form method="POST" action="--WEBBOT-SELF--" onsubmit="PrintResult()">
<p>Количество кухонь:<span lang="en-us"> </span> <select size="1" id="kitchen">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<p>Количество ванн:<span lang="en-us"> </span> <select size="1" id="bathroom">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<p>Оставшаяся площадь:<span lang="en-us"> </span> <input type="text" id="square" size="10"></p>
<p>Количество окон (одностворчатых):<span lang="en-us"> </span> <input type="text" id="window1" size="10" value=0>0</p>
<p>Количество окон (двустворчатых):<span lang="en-us"> </span> <input type="text" id="window2" size="10" value=0>0</p>
<p>Площадь всех лоджий<span lang="en-us">
<input type="text" id="balcon" size="10"></span> <span lang="en-us"> </span></p>
<p>Степень загрязнения квартиры <select size="1" id="dirty">
<option selected value="2">Сильнозагрязненная</option>
<option value="1">Среднезагрязненная</option>
<option value="0">Слабозагрязненная</option>
</select></p>
<p>После ремонта <input type="checkbox" id="maintance" value="1"></p>
<p>С нашими средствами<span lang="en-us"> </span>
<input type="checkbox" id="chemical" value="1"></p>
<p>За пределами КАД<span lang="en-us">
<input type="checkbox" id="KAD" value="1"></span></p>
<input type="submit" value="Рассчитать" name="B1"> <span id="result">0</span></p>
</form>