V2 trying with math

by Andrew Warren

HTML

<form>
<p>Membership type:</p>
		<label for="radio90" class="pure-radio">
	<input type="radio" name="join_as_a_competitor" id="radio90" class="items join_as_a_competitor"
	value="champcomp"/> 
	Competitor (Championship registered - &pound;30)
    </label><br/>
<label for="radio92" class="pure-radio">
	<input type="radio" name="join_as_a_competitor" id="radio92" class="items join_as_a_competitor"
	value="noncomp"/> 
	Non Competitor/Marshall - &pound;free
</label>

<p> How would you like to pay for membership:  </p>
<label for="radio220" class="pure-radio">
	<input type="radio" name="how_would_you_like_to_pay_for_membership" id="radio220" 
class="payment1"	value="Cheque"/> 
	Cheque
</label><br/>
<label for="radio222" class="pure-radio">
	<input type="radio" name="how_would_you_like_to_pay_for_membership" id="radio222" 
class="payment1"	value="Paypal"/> 
	Paypal
</label>


<label for="total_membership_payment"> <p>Total membership payment &pound;: </p></label> 
<input type="text" name="total_membership_payment" id="hidd_item1" value="" readonly>
</form>

JavaScript

$('.items').click (function () {
if ($(this).val() == "champcomp" || $(this).val() == "competitor" ) {
    var value = parseFloat(30.01); } else { var value = parseFloat(0.00); }
        $('#hidd_item1') .val(value);
    }); 

$('.payment1').click (function () {
if ($(this).val() == "Paypal"  ) {
    var paypalfee = parseFloat(1.26)
    var value = parseFloat(value) + parseFloat(paypalfee); } else { var value = Number(30.00); }
        $('#hidd_item1') .val(value);
    });