I have the following code which works in FireFox and IE but for some reason and I have no idea why it does nto work in Safari.
Could someone please tell me why, it is driving me nuts!
Code: Select all
<!DOCTYPE HTML PUBLIC "e;-//W3C//DTD HTML 4.01 Transitional//EN"e; "e;http://www.w3.org/TR/html4/loose.dtd"e;>
<html>
<head>
<meta http-equiv="e;Content-Type"e; content="e;text/html; charset=iso-8859-1"e;>
<title>Calculator</title>
<script type="e;text/javascript"e;>
function smatotal()
{
var smaqty = 0;
if (document.Calc.restqty.value >= 1)
{
smaqty++;
}
if (document.Calc.visqty.value >= 1)
{
smaqty++;
}
if (document.Calc.classqty.value >= 1)
{
smaqty++;
}
if (document.Calc.acqqty.value >= 1)
{
smaqty++;
}
return smaqty;
}
function addsmatotal()
{
var addsmaqty = 0;
if (document.Calc.restqty.value > 1)
{
addsmaqty = addsmaqty + (document.Calc.restqty.value - 1);
}
if (document.Calc.visqty.value > 1)
{
addsmaqty = addsmaqty + (document.Calc.visqty.value - 1);
}
if (document.Calc.classqty.value > 1)
{
addsmaqty = addsmaqty + (document.Calc.classqty.value - 1);
}
if (document.Calc.acqqty.value > 1)
{
addsmaqty = addsmaqty + (document.Calc.acqqty.value - 1);
}
return addsmaqty;
}
</script>
<link href="e;/css/verdana_table.css"e; rel="e;stylesheet"e; type="e;text/css"e;>
</head>
<body class="e;BodyText"e;>
<CENTER>
<FORM NAME="e;Calc"e;>
<table width="e;250"e; border="e;0"e; cellpadding="e;0"e; cellspacing="e;5"e; class="e;TableBorder"e;>
<tr class="e;Title"e;>
<td width="e;200"e;>Product</td>
<td width="e;50"e;>Qty</td>
</tr>
<tr>
<td width="e;200"e;>Restoration</td>
<td width="e;50"e;><input name="e;restqty"e; type="e;text"e; id="e;restqty"e; value="e;0"e; size="e;2"e; maxlength="e;2"e;></td>
</tr>
<tr>
<td width="e;200"e;>Visualization</td>
<td width="e;50"e;><input name="e;visqty"e; type="e;text"e; id="e;visqty"e; value="e;0"e; size="e;2"e; maxlength="e;2"e;></td>
</tr>
<tr>
<td width="e;200"e;>Classification</td>
<td width="e;50"e;><input name="e;classqty"e; type="e;text"e; id="e;classqty"e; value="e;0"e; size="e;2"e; maxlength="e;2"e;></td>
</tr>
<tr>
<td width="e;200"e;>Acquisition</td>
<td width="e;50"e;><input name="e;acqqty"e; type="e;text"e; id="e;acqqty"e; value="e;0"e; size="e;2"e; maxlength="e;2"e;></td>
</tr>
<tr>
<td colspan="e;2"e;>
<div align="e;center"e;>
<input name="e;Calculate"e; type="e;button"e; value="e;Calculate"e; onclick="e;window.location.reload()"e;>
<input type="e;reset"e; name="e;Reset"e; value="e;Reset"e;>
</div></td>
</tr>
</table>
</FORM>
<script>
if ( smatotal() > 0) {
document.write('You need to order ' +smatotal()+ ' SMAs');
} else {
document.write('<p>Enter your license quantities above to calculate the correct SMA combinations to order.</p>');
}
if ( addsmatotal() > 0) {
document.write('<p>You need to order ' +addsmatotal()+ ' additional SMA licenses</p>');
}
</script>
</CENTER>
</body>
</html>