<script language='javascript'>
function do_math(f)
{
var kolvo = f.elements['kolvo'].value;
var cena = f.elements['cena'].value;
var res =cena*parseInt(kolvo);
f.elements['r'].value = isNaN(res.toPrecision(1)) ? '' : res.toFixed(2);
}
</script>
<form action="" method="post">
<table border="0" width="400px" align="center">
<tr>
<td width="50%" align="left"><b>Количество:</b><br><br></td>
<td width="50%" align="left">
<input type="text" name="kolvo" onChange="do_math(this.form)" size="15" maxlength="10">
</td>
</tr>
<tr>
<td width="50%" align="left"><b>Цена:</b><br><br></td>
<td width="50%" align="left">
<input type="text" name="cena" onChange="do_math(this.form)" size="15" maxlength="10" />
</td>
</tr>
<tr>
<td width="150" align="left"><p>
<label><b>Всего:</b></label>
</td>
<td width="250" align="left">
<input type="text" name="r" size="15" maxlength="5" tabindex="4"/>
</td>
</tr>
</table>
</form>