|
Radiobutton calculation
Hi there, I'm trying to figure this out and hoping someone can assist so I can use it as a base for my calculations.
If the number entered is less than 30 and 'one course' is checked, the cost pp should be $15. If the number entered is less than 30 and 'two course' is checked, the cost pp should be $20. If the number entered is more than 30 and 'one course' is checked, the cost pp is $25 and so on.
I got got to here so far..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>BuffetQuote 2012 </title>
<script type="text/javascript">
function btncheckform_onclick()
{
var cost = document.form1.numberofpeople.value;
var course = document.form1.course.checked;
var tlcost =
if (cost<30 && course.checked) = true;
then document.form2.totalcost.value=tlcost;
}
</script>
</head>
<body>
<form action="script.url"name="form1">
Number of people: <input type="text" name="numberofpeople" onblur ="numberofpeople_onblur()" size ="30"
/> <br />
<h1>Select number of courses required</h1>
<input type="radio" name="course" value="one" /> One Course
<input type="radio" name="course" value="two" /> Two Course
<br /><br />
<input type="button" value="Submit Quote"
name= "btncheckform" onclick="btncheckform_onclick()"/>
<input type="reset" value="Reset Quote"/>
</form>
<form action="scripting.url"name="form2">
Total Cost: <input type="text" name="tlcost" size="30";
/> <br />
</form>
</body>
</html>
|