Помогите пожалуйста сделать калькулятор:
Сразу оговорю кое что - никогда не изучал яваскрипты, взял готовый который работал, попытался переделать под себя - не вышло.
вот код скрипта:
function load()
{
window.status = "Made by Ville Leivo 15.07.2002"
}
function count()
{
//Цены на ручки
var ruch1price = 700;
var ruch2price = 1400;
//Условия для ручек
if (calc.ruch1.checked){
var wruch1 = document.calc.ruch1.value = ruch1price;
} else {
var wruch1 = document.calc.ruch1.value = 0;
}
if (calc.ruch2.checked){
var wruch2 = document.calc.ruch2.value = ruch2price;
} else {
var wruch2 = document.calc.ruch2.value = 0;
}
document.calc.pay.value = wruch1 + wruch2;
}
код html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Тест</title>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251'/>
<script type="text/javascript" src="/js/z.js"></script>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="4">
<tr>
<td width="610">
<b>Ручка один<br>ЦЕНА: 700 руб.</b>
</td>
<td width="15"><input name="ruch1" type="checkbox" value="on"></td>
</tr>
<tr>
<td width="610">
<b>Ручка два<br>ЦЕНА: 1400 руб.</b>
</td>
<td width="15"><input name="ruch2" type="checkbox" value="on"></td>
</tr>
<table width="625" border="2" cellspacing="0" cellpadding="4">
<tr>
<td align="right">
Цена: <input type="text" name="pay" size="10" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
<input type="button" onClick="count()" value="Рассчитать" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px"> <input type="reset" value="Очистить" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
</td>
</tr>
</table>
</body>
</html>
спасибо