I'm trying to make a registration form, and one part of that is it needs to be able to add the values of input types and displays it at the bottom.

This is what I've done for the JS;


PHP Code:
//Calculate checkbox 
var total 0

function 
ShowTotal(obj){ 

   var 
price; var i
   if (
obj.checked)                              
      
total total + eval(obj.value); 
   else                                          
      
total total - eval(obj.value); 

   return; 


//Calculate radio 
var pro 0

  function 
ShowProTotal(obj
  { 
    var 
price; var i
    if (
obj.checked
      
pro pro + eval(obj.value); 
    else 
      
pro pro - eval(obj.value); 
    return; 
  } 
   
//Calculates total cost 
 
function getTotal(){ 
     var 
totalCost ShowTotal() + ShowProTotal(); 

     
document.getElementById("regform").cost.value totalCost
     } 
And this is the HTML parts of it which are affected by it;

PHP Code:
//Checkbox 
        
<dd
            <
label
                <
input name="attend" value="50.00" type="checkbox" onclick="getTotal()" />Monday 
            
</label
            <
label
                <
input name="attend" value="50.00" type="checkbox" onclick="getTotal()" />Tuesday 
            
</label
            <
label
                <
input name="attend" value="50.00" type="checkbox" onclick="getTotal()" />Wednesday 
            
</label
        </
dd


//Radio buttons 

        
<dd
            <
label
                <
input name="proceedings" value="50" type="radio" checked="checked" onclick="getTotal();" />Yes 
            
</label
            <
label
                <
input name="proceedings" value="0" type="radio" onclick="getTotal();" />No 
            
</label
        </
dd


//Where result should be displayed 
        
<dd
            <
input id="cost" name="cost" class="formtextfield" type="text" /> 
        </
dd
I've omitted the rest of the code out for clarity, I'm not entirely sure where the problem is because when I try it with just the Checkbox it seems to be displaying the result fine. I'm probably doing something very wrong with the funtions.

Any help on this would be very much appreciated. Thanks