<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Services</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<script>
function calculateTotal(){
var total;
var theForm = document.forms["optionform"]; {
var selectedServices = theFrom.elements["selectedServices"];
var servicePrices = new Array();
servicePrices["Oil and Filter Change"]= 21.00;
servicePrices["Mini-Service"]= 35.00;
servicePrices["Tire Rotation and Balance"]= 45.00;
servicePrices["Major Service 4 cyl"]= 125.00;
servicePrices["Minor Service 4 cyl"]= 100.00;
servicePrices["Major Service 6 cyl"]= 150.00;
servicePrices["Minor Service 6 cyl"]= 120.00;
servicePrices["Brake Services"]= 50.00;
servicePrices["Standard Car Wash"]= 20.00;
servicePrices["Car Detailing"]= 90.00;
servicePrices["Engine Change Out"]= 800.00;
}
$(document).ready(function() {
$('input[type="checkbox"]').live('change', function() {
calculateTotal();
});
});
</script>
</head>
<body>
<div id="container">
<div id="header">
<p>Motor City Repair Services Menu</p>
</div><!--end header-->
<div id="optionform">
<p align="center">Choose Services From the Menu:</p>
<form>
<span><input type="checkbox" name="Oil and Filter Change" onclick="calculateTotal()">Oil and Filter Change: $21.00</span><br />
<span><input type="checkbox" name="Mini-Service" onclick="calculateTotal()">Mini-Service: $35.00</span><br />
<span><input type="checkbox" name="Tire Rotation and Balance" onclick="calculateTotal()">Tire Rotation and Balance: $45.00</span><br />
<span><input type="checkbox" name="Major Service 4 cyl">Major Service 4 cyl: Parts + Labor</span><br />
<span><input type="checkbox" name="Minor Service 4 cyl">Minor Service 4 cyl: Parts + Labor</span><br />
<span><input type="checkbox" name="Major Service 6 cyl">Major Service 6 cyl: Parts + Labor</span><br />
<span><input type="checkbox" name="Minor Service 6 cyl">Minor Service 6 cyl: Parts + Labor</span><br />
<span><input type="checkbox" name="Break Service">Break Service: $50.00</span><br />
<span><input type="checkbox" name="Standard Car Wash">Standard Car Wash: $20.00</span><br />
<span><input type="checkbox" name="Car Detailing">Car Detailing: $90.00</span><br />
<span><input type="checkbox" name="Engine Change Out">Engine Change Out: Parts + Labor</span><br />
<span><input type="submit" name="submit" value="Submit" /></span>
</form>
<p>
Total: <span class="total"></span>
</p>
</div><!--end optionform-->
<div id="footer">
<p>Developed by Quality Code</p>
</div>
</div><!--end container-->
</body>
</html>
And yes, I misspelled form in "theFrom.elements". It has been fixed.

New Topic/Question
Reply


MultiQuote



|