Мне нужно что прибавлял стоимость, а не рядом ставил, как подправить?
<form id="comment" name="frm" method="POST" action="" accept-charset="Windows-1251">
<table>
<tr>
<td rowspan="10" width="40%"><b>Призовые места</b>
</td>
<td class="value" colspan="2"><span class="place1">1</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize1" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="place2">2</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize2" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="place3">3</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize3" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="placen">4</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize4" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="placen">5</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize5" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="placen">6</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize6" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="placen">7</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize7" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="placen">8</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize8" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="placen">9</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize9" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td class="value" colspan="2"><span class="placen">10</span><input class="val" style="width: 80px; margin-top: 2px;" type="text" name="tbl_prize10" maxlength="10" value="0.00" onChange="PlanChange(this.form); return false;"> руб.</td>
</tr>
<tr>
<td>Призовой фонд:</td>
<td class="price">
<input type='text' class='summa' size='20' maxlength='20' readonly='readonly' name='summa' value="0.00 руб." style="width:200px;">
</td>
</tr>
</table>
</form>
<script language=javascript>
function number_format(number, decimals, dec_point, thousands_sep) {
var i, j, kw, kd, km;
if (isNaN(decimals = Math.abs(decimals))) { decimals = 2; }
if (dec_point == undefined) { dec_point = ","; }
if (thousands_sep == undefined) { thousands_sep = "."; }
i = parseInt(number = (+number || 0).toFixed(decimals)) + "";
if ((j = i.length) > 3) { j = j % 3; } else { j = 0; }
km = (j ? i.substr(0, j) + thousands_sep : "");
kw = i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands_sep);
kd = (decimals ? dec_point + Math.abs(number - i).toFixed(decimals).replace(/-/, 0).slice(2) : "");
return km + kw + kd;
}
var celoe;
var drob;
var res;
function okrugl(nums)
{
celoe=Math.floor(nums);
drob=(nums-celoe)*100;
drob=Math.floor(drob);
if(drob>=10)
{
res=celoe+'.'+drob;
}else{
res=celoe+'.0'+drob;
}
return res;
}
function PlanChange(frm, toChange){
var vid=0;
lprice = vid;
if (frm.tbl_prize1.value > 0) { lprice=lprice+frm.tbl_prize1.value; }
if (frm.tbl_prize2.value > 0) { lprice=lprice+frm.tbl_prize2.value; }
if (frm.tbl_prize3.value > 0) { lprice=lprice+frm.tbl_prize3.value; }
if (frm.tbl_prize4.value > 0) { lprice=lprice+frm.tbl_prize4.value; }
if (frm.tbl_prize5.value > 0) { lprice=lprice+frm.tbl_prize5.value; }
if (frm.tbl_prize6.value > 0) { lprice=lprice+frm.tbl_prize6.value; }
if (frm.tbl_prize7.value > 0) { lprice=lprice+frm.tbl_prize7.value; }
if (frm.tbl_prize8.value > 0) { lprice=lprice+frm.tbl_prize8.value; }
if (frm.tbl_prize9.value > 0) { lprice=lprice+frm.tbl_prize9.value; }
if (frm.tbl_prize10.value > 0) { lprice=lprice+frm.tbl_prize10.value; }
frm.summa.value = number_format(lprice, 2, '.', '')+' руб.';
}
</script>