can anyone help me solve this code
Code Javascript:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Accident Inquiry Insurance Calculator</title>
</head>
<script type="text/javascript">
function calculation()
{
var cover;
var policy;
var premium;
if (document.form.budget.checked)
cover = 2;
else if(document.form.premier.checked)
cover = 3;
else (document.form.superior.checked)
cover = 5;
if (cover ==0)
alert ("level of cover");
else if (freq==0)
alert ("frequency of payment");
else
alert ((cover*premium)+policy);
}
</script>
<body>
<form id = "form" name = "form">
<h1>Accident Inquiry Insurance Calculator</h1>
<p>Complete the form below to calculate the cost of your personal accident insurance.</p>
Level of Cover:<br/>
<br/><input name="cover" input id = "budget" type="radio" value="2" /><label for = "Budget">Budget</label><br/>
<input name="cover" input id = "premier" type="radio" value="3" /><label for = "Premier">Premier</label><br/>
<input name="cover" input id = "superior" type="radio" value="5" /><label for = "Superior">Superior</label><br/>
<p>Click here if you want this policy to cover your spouse and children:<input name="policy" type="checkbox" value="$3" /> </p>
Frequency of Premium Payments:<br/>
<br/><input name="premium" input id = "weekly" type="radio" value="1" /><label for = "Weekly">Weekly</label><br/>
<input name="premium" input id = "monthly" type="radio" value="4" /><label for = "Monthly">Monthly</label><br/>
<input name="premium" input id = "yearly" type="radio" value="52" /><label for = "Yearly">Yearly</label><br/>
<br/><input type="button" name="button" id="display" value="Calculate" onclick="calculation();" />
<input type="reset" name="reset" id="reset" value="Reset" />
</form>
</body>
</html>
Re: can anyone help me solve this code
javascript != java. These are java forums, and I presume this refers to javascript. You might try your luck on a javascript specific forum, and should you want help here or elsewhere you should provide a lot more information than 'help me solve this' when reader's don't know what to solve.