Okay so you want to do something like this -- assuming that you are echoing everything to the page with
PHP
- PHP: Select all
echo '
<script type="text/javascript">
var totalPrice = ', $totalPrice, ';
function workoutnewPrice(passedObject)
{
if (passedObject.checked && !isNaN(parseInt(passedObject.value)) {
totalPrice += parseInt(passedObjec.value);
alert(totalPrice);
}
}
</script>';
Then on your radio buttons add onclick="workoutnewPrice(this)"
Hope that helps,