Hey guys,
I've got a problem with my radio buttons. Before i put them in my check boxes where adding up a total this is the code
- Code: Select all
<script type="text/javascript">
<!--
function UpdateCost() {
var sum = 0;
var gn, elem;
for (i=0; i<15; i++) {
gn = 'game'+i;
elem = document.getElementById(gn);
if (elem.checked == true) { sum += Number(elem.value); }
}
document.getElementById('totalcost').value = sum.toFixed(2);
}
// -->
</script>
Then when i tried to put radio buttons in nothing worked heres what i got so far :
- Code: Select all
<input type="checkbox" id='game9' value="2.99" onChange="UpdateCost()">£2.99<br>
</div>
<p>
What type of postage would you like? (We use Royal mail to deliver our games)
</p>
<input type="radio" id="game10" value="0" onChange="UpdateCost()" />free delivery<br/>
<input type="radio" id="gamw11" value="2.20" onChange="UpdateCost()"/>Next day delivery £2.20<br/>
<input type="radio" name="Post" value="3.20" onChange="UpdateCost()"/>Saturday delivery £3.20<br/>
Thanks for the help!
