Forum Moderators: open
<!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=US-ASCII"/>
<link rel="stylesheet" type="text/css" href="hw5.css" />
<title>HW 5 Tix Calc</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js">
</script>
</head>
<body>
<script tyep="text/javascript">
function validateInput()
{
Quantity=quantity("quantity");
if (Quantity <= "0" || >= "10"){
alert ("Please enter a quantity greater than zero or no more than 10.");
return false;
}else{
return true;
}
}
}
</script>
<h1 class="center">Ticket Cost Calculator</h1>
<form name=frmOrder>
<div>
<table class="table" >
<tr>
<th>Location:</th>
<th>Quantity:</th>
</tr>
<tr>
<td><select name="location" onChange="compute_total()">
<option value="E">End zone $10</option>
<option value="NB">Not bad $20</option>
<option value="G">Good $30</option>
</select>
</td>
<!--enter ticket quantity -->
<td>
<input type="text" value="" name="quantity" maxlength="2" value="" size="9" onChange=validateInput(this.value) />
</td>
</tr>
<tr>
<td>Subtotal:</td>
<td>
<input type="text" name="subtotal" value="" size="9" readonly="readonly" />
</td>
</tr>
<tr>
<td>
<input type="radio" class="radio" name="delivery" value="WC"/>Will Call ($5) or
<p><input type="radio" class="radio" name="delivery" value="OD"/> Overnight Deliver ($15)</p>
</td>
<td>
<input type="text" name="$willcall" value="" size="9" readonly="readonly" onChange="compute_total()"/>
</td>
</tr>
<tr>
<td>Grand Total:</td>
<td>
<input type="text" name="grandtotal" value="" size="9" readonly="readonly"/>
</td>
</tr>
<tr>
<td>
<input type="submit" name="calculate" value="Calculate or Recalculate" onClick="calculate()"/>
</td>
<td>
<input type="reset" name="reset" value="Start Over"/>
</td>
</tr>
</table>
</div>