בבקשה, משהו בסיסי ביותר, אבל די ברור איך להמשיך מכאן:
HTML קוד:
<html>
<head>
<title></title>
<script language="javascript">
function amountKeyUp()
{
var amount = document.form1.amount.value;
var amount1 = document.form1.amount1.value;
var hide = document.form1.hide.value;
var total = document.form1.total.value;
var total1 = document.form1.total1.value;
var sum = document.form1.sum.value;
total = amount * hide;
total1 = amount1 * hide;
sum = total + total1;
document.form1.total.value = total;
document.form1.total1.value = total1;
document.form1.sum.value = sum;
}
</script>
</head>
<body>
<form name="form1">
<input type="hidden" name="hide" value="5">
<br>
<input type="text" onkeyup="amountKeyUp();" name="amount">
<br>
<input type="text" onkeyup="amountKeyUp();" name="amount1">
<br>
<input type="text" name="total">
<br>
<input type="text" name="total1">
<br>
<input type="text" name="sum" value="0">
</form>
</body>
</html>
בהצלחה