please can someone help me solve this java scprit, i am trying to get the payment form to substract from the tour form. i have got part of it working apart from the substraction. thank you
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>newzealand hoilday</title>
<script type="text/javascript" language="javascript">
function calculateCost() {
var extra = 0;
var other = document.getElementById('other');
if (other.checked){
extra = parseInt(other.value);
}
// add up the cost of the selected tour and payment
var cost = 0; //cost of the selected tour
for (var i= 1; i <= 4; i++) {
tour = document.getElementById("tour" + i);
if (tour.checked == true) {
cost = parseInt(tour.value)+cost;
}
}
// Display the total cost of the selected tour)
alert("The approximate cost $" + cost);
}
</script>
</head>
<body>
<h1>New Zealand Holiday Price Calculator</h1>
<p>Complete the form below to calculate the cost of your New zealand hoilday:</p>
<form id="form1">
<p>Tour type:<br />
<input type="radio" id="tour1" name="tours" value="1500"/>
<label for="tour1">12-day New Zealand Escape Tour</label><br />
<input type="radio" id="tour2" name="tours" value="1600"/>
<label for="tour2">14-day New zealand Panorama Tour</label><br />
<input type="radio" id="tour3" name="tours" value="1750"/>
<label for="tour3">15-day New zealand South to North Tour</label><br />
<input type="radio" id="tour4" name="tours" value="2100" />
<label for="tour4">17-day Best of New zealand Tour</label>
</p>
</form>
<form id="form2" >
<p> Payment date:<br />
<input type="radio" id="payment1 " name="payments" value="200"/>
<label for="payment1">Before 1st August 2010 </label><br />
<input type="radio" id="payment2" name="payments" value="150" />
<label for="payment2">Between 1st and 31st August 2010</label><br />
<input type="radio" id="payment3" name="payments" value="100 " />
<label for="payment3">Between 1st and 30th september 2010 </label><br />
<input type="radio" id="payment4" name="payments" value="0" />
<label for= "payment4">After 30th September 2010</label>
</p>
<p>Click here if you wnat to include an airfare from Sydney, Brisbane or Melbourne:
<input type="checkbox" id="other" name="extra"value="400" />
<P>
<input type="submit" value="Calculate"
onClick="calculateCost();" /> <input type="reset" />
</p>
<p>
</p>
</form>
</body>
</html>