Hey, as the title says i need some help. I currently have a contact form ( self made). Easiest way to explain.
I have a form : http://martinlougas.eu/pood.html . Problem is that on the right side the checkboxes, once you check them the price (shown after the name) has to display in a box under "Summa". Currently it is only showing when all of the boxes are checked. ( Yes i know that one is selected by default, it has to be and it has to be not "deselectable" . After the price displaying is okay, it should send it to certain email with all the info ( boxes) selected and showing the price.

If it was hard to understand. If you select for example Line-X then 350 will be added to the "Summa" box, if you deselect it, it will be taken away from there. Default value should be 50 since one of the boxes is always selected.


Current code is:


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
// From: http://www.webdeveloper.com/forum/sh...d.php?t=235581

function getRBtnName(GrpName) {
var sel = document.getElementsByName(GrpName);
var fnd = -1;
var str = '';
for (var i=0; i<sel.length; i++) {
if (sel[i].checked == true) { str = sel[i].value; fnd = i; }
}
// return fnd; // return option index of selection
// comment out next line if option index used in line above
return str;
}

function DisplayPrice(price){
var val1 = getRBtnName('part1').split(',');
var val2 = getRBtnName('part2').split(',');
var val3 = getRBtnName('part3').split(',');
var val4 = getRBtnName('part4').split(',');
var val5 = getRBtnName('part5').split(',');
var val6 = getRBtnName('part6').split(',');
var val7 = getRBtnName('part7').split(',');
var val8 = getRBtnName('part8').split(',');
var val9 = getRBtnName('part9').split(',');


var sum=parseInt(val1[0]) + parseInt(val2[0])+ parseInt(val3[0])+ parseInt(val4[0])+ parseInt(val5[0])+ parseInt(val6[0])+ parseInt(val7[0])+ parseInt(val8[0])+ parseInt(val9[0]);
document.getElementById('totalSum').value=sum+".00 €";

}
onload=function() {
DisplayPrice();
}

</script>
</head>
<body>
<table class="puuks" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr class="puuks">
<td class="puuks" valign="top" width="350">
<strong>Valitse oikea kamina:</strong><br>
<input name="part1" type="radio"
onclick="DisplayPrice();" value="0" checked="CHECKED">Uppokamina (27kw) - 0 &euro;- vakio<br>
<input name="part1" type="radio"
onclick="DisplayPrice();" value="249">Ulkokamina (27kw) - 249.00 &euro;<br>
<input type="radio" value="279" name="part1"
onclick="DisplayPrice();">Uppokamina (40kw) - 279.00 &euro;<br>
<input type="radio" value="395" name="part1"
onclick="DisplayPrice();">Ulkokamina (40kw) - 395.00 &euro;<br>
</td>
<td class="puuks" valign="top" width="350">
<strong>Kylpytynnyrin lisävarusteet:</strong><br>
<input type="checkbox" value="0" name="part2"
onclick="DisplayPrice();">Line – X (suosittelemme) - 350.00 &euro;<br>
<input type="checkbox" value="49" name="part3"
onclick="DisplayPrice();">Kansi mänty (suosittelemme) – 49.00 &euro;<br>
<input type="checkbox" value="45" name="part4"
onclick="DisplayPrice();">Suojapressu - 45.00 &euro;<br>
<input type="checkbox" value="40" name="part5"
onclick="DisplayPrice();">Poltettu mänty – 40.00 &euro;<br>
<input type="checkbox" value="250" name="part6"
onclick="DisplayPrice();">Lämpökäsitelty mänty - 250.00 &euro;<br>
<input type="checkbox" value="50" name="part7" onclick="return false" checked
onclick="DisplayPrice();">Valmiiksi koottuna – 50.00 &euro;<br>
<input type="checkbox" value="300" name="part8"
onclick="DisplayPrice();">Porejärjestelma – 300.00 &euro;<br>
<input type="checkbox" value="300" name="part9"
onclick="DisplayPrice();">LED valot - 300.00 &euro;<br>
</td>
<td class="puuks" float="right" valign="top">

<h2>Summa</h2><input type="text" id="totalSum" value="" size="25" readonly border="0">

<p>Etu- ja sukunimi</p>
<input name="name" type="text" value="" size="25">
<p>Sähköposti</p> <input name="email" type="text" size="25">
<p>Puhelin</p> <input name="email" type="text" size="25">
<p>Osoite</p> <input name="email" type="text" size="25">
<p>Lisätietoja</p><textarea name="message" rows="3" cols="21"></textarea><br />
<input type="submit" value="Tilaa kylpytynnyri">

</form>
</td>
</tr>
</tbody>
</table>



</body>
</html>


If something is still not understandable please tell me. Sorry for my bad english.