R
rick
I am new to javascript and would appreciate any help that is offered.
The following script does not work in IE (the value
(document.quote.qty1.value)is not
displayed in the "equiptotal" field).
Can anyone tell where I went wrong? The script works fine in
Mozilla/Firefox.
//The script
function recalc() {
document.quote.equiptotal.value = document.quote.qty1.value;
}
// The Page
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="DreamWeaver">
<link rel="stylesheet" type="text/css" href="/css/web-soft.css">
<title>Quotation</title>
<SCRIPT LANGUAGE="JavaScript" src="/javascript/quote.js">
</script>
</head>
<BODY><center>
<form action="" method="post" name="quote">
<div id="quote">
<div id="smallbar">WEB Soft Systems Inc.</div>
Quotation
<table class="quote" cellspacing="2" cellpadding="2">
<tr>
<th>Qty</th>
<th>Item Num</th>
<th>Supplier</th>
<th>Description</th>
<th>Cost</th>
<th>Hrs</th>
</tr>
<tr>
<td class="small"><input type="text" name="qty1" size="4"
onChange="recalc()" maxlength="4"></td>
<td class="medium"><input name="itemnum1" type="text" id="itemnum1"
size="15"></td>
<td class="medium"><input name="supplier1" type="text" id="supplier1"
size="20"></td>
<td class="large"><input name="description1" type="text" id="description1"
size="30"></td>
<td class="medium"><input type="text" name="unitcost1" size="7"></td>
<td class="small"><input type="text" name="labor1" size="4"
maxlength="4"></td>
</tr>
</table>
<br>
<table class="quote" cellspacing="2" cellpadding="0">
<tr>
<th>Company</th>
<th>Site</th>
<th>Contact</th>
<th></th>
</tr>
<tr>
<td class="medlarge"> </td>
<td class="medlarge"> </td>
<td class="medlarge"> </td>
<td><input type="submit" name="select" value="Select"></td>
</tr>
</table>
<br>
<table class="quote" cellspacing="2" cellpadding="0">
<tr>
<td class="medium" align="right">Equip Cost</td>
<td class="medium" align="left"><input type="text" name="equipcost" readonly
size="10"></td>
<td class="medium" align="right">Equip Total</td>
<td class="medium" align="left"><input type="text" name="equiptotal"
readonly size="10"></td>
<td class="medium" align="right">Sub Total</td>
<td class="medium" align="left"><input type="text" name="subtotal" readonly
size="10"></td>
<td class="small" align="left"></td>
</tr>
<tr>
<td class="medium" align="right">Labour Hrs</td>
<td class="medium" align="left"><input type="text" name="totallabor"
size="10" readonly></td>
<td class="medium" align="right">Mark-Up</td>
<td class="medium" align="left"><input type="text" name="markup"
onChange="recalc()" size="3" maxlength="4">%</td>
<td class="medium" align="right">PST 8%</td>
<td class="medium" align="left"><input type="text" name="pst" size="10"
readonly></td>
<td class="small" align="left"><input type="checkbox" name="check1"
value="Value1"></td>
</tr>
<tr>
<td class="medium" align="right">Labour Rate</td>
<td class="medium" align="left"><input type="text" name="laborrate"
size="10" readonly></td>
<td class="medium" align="right">Gross Margin</td>
<td class="medium" align="left"><input type="text" name="grossmargin"
size="10"></td>
<td class="medium" align="right">GST 7%</td>
<td class="medium" align="left"><input type="text" name="gst" size="10"
readonly></td>
<td class="small" align="left"><input type="checkbox" name="check2"
value="Value2"></td>
</tr>
<tr>
<td class="medium" align="right">Total Labour</td>
<td class="medium" align="left"><input type="text" name="laborcost"
size="10" readonly></td>
<td class="medium" align="right">Gross Profit </td>
<td class="medium" align="left"><input type="text" name="grossprofit"
size="10"></td>
<td class="medium" align="right">Total</td>
<td class="medium" align="left"><input type="text" name="total" size="10"
maxlength="10" readonly></td>
<td class="small" align="left"><input type="checkbox" name="check3"
value="Value3"></td>
</tr>
</table><br>
</div>
<div id="footer">Copyright©2004 R.M. Singh</div>
</form>
</body>
</center>
</html>
The following script does not work in IE (the value
(document.quote.qty1.value)is not
displayed in the "equiptotal" field).
Can anyone tell where I went wrong? The script works fine in
Mozilla/Firefox.
//The script
function recalc() {
document.quote.equiptotal.value = document.quote.qty1.value;
}
// The Page
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="DreamWeaver">
<link rel="stylesheet" type="text/css" href="/css/web-soft.css">
<title>Quotation</title>
<SCRIPT LANGUAGE="JavaScript" src="/javascript/quote.js">
</script>
</head>
<BODY><center>
<form action="" method="post" name="quote">
<div id="quote">
<div id="smallbar">WEB Soft Systems Inc.</div>
Quotation
<table class="quote" cellspacing="2" cellpadding="2">
<tr>
<th>Qty</th>
<th>Item Num</th>
<th>Supplier</th>
<th>Description</th>
<th>Cost</th>
<th>Hrs</th>
</tr>
<tr>
<td class="small"><input type="text" name="qty1" size="4"
onChange="recalc()" maxlength="4"></td>
<td class="medium"><input name="itemnum1" type="text" id="itemnum1"
size="15"></td>
<td class="medium"><input name="supplier1" type="text" id="supplier1"
size="20"></td>
<td class="large"><input name="description1" type="text" id="description1"
size="30"></td>
<td class="medium"><input type="text" name="unitcost1" size="7"></td>
<td class="small"><input type="text" name="labor1" size="4"
maxlength="4"></td>
</tr>
</table>
<br>
<table class="quote" cellspacing="2" cellpadding="0">
<tr>
<th>Company</th>
<th>Site</th>
<th>Contact</th>
<th></th>
</tr>
<tr>
<td class="medlarge"> </td>
<td class="medlarge"> </td>
<td class="medlarge"> </td>
<td><input type="submit" name="select" value="Select"></td>
</tr>
</table>
<br>
<table class="quote" cellspacing="2" cellpadding="0">
<tr>
<td class="medium" align="right">Equip Cost</td>
<td class="medium" align="left"><input type="text" name="equipcost" readonly
size="10"></td>
<td class="medium" align="right">Equip Total</td>
<td class="medium" align="left"><input type="text" name="equiptotal"
readonly size="10"></td>
<td class="medium" align="right">Sub Total</td>
<td class="medium" align="left"><input type="text" name="subtotal" readonly
size="10"></td>
<td class="small" align="left"></td>
</tr>
<tr>
<td class="medium" align="right">Labour Hrs</td>
<td class="medium" align="left"><input type="text" name="totallabor"
size="10" readonly></td>
<td class="medium" align="right">Mark-Up</td>
<td class="medium" align="left"><input type="text" name="markup"
onChange="recalc()" size="3" maxlength="4">%</td>
<td class="medium" align="right">PST 8%</td>
<td class="medium" align="left"><input type="text" name="pst" size="10"
readonly></td>
<td class="small" align="left"><input type="checkbox" name="check1"
value="Value1"></td>
</tr>
<tr>
<td class="medium" align="right">Labour Rate</td>
<td class="medium" align="left"><input type="text" name="laborrate"
size="10" readonly></td>
<td class="medium" align="right">Gross Margin</td>
<td class="medium" align="left"><input type="text" name="grossmargin"
size="10"></td>
<td class="medium" align="right">GST 7%</td>
<td class="medium" align="left"><input type="text" name="gst" size="10"
readonly></td>
<td class="small" align="left"><input type="checkbox" name="check2"
value="Value2"></td>
</tr>
<tr>
<td class="medium" align="right">Total Labour</td>
<td class="medium" align="left"><input type="text" name="laborcost"
size="10" readonly></td>
<td class="medium" align="right">Gross Profit </td>
<td class="medium" align="left"><input type="text" name="grossprofit"
size="10"></td>
<td class="medium" align="right">Total</td>
<td class="medium" align="left"><input type="text" name="total" size="10"
maxlength="10" readonly></td>
<td class="small" align="left"><input type="checkbox" name="check3"
value="Value3"></td>
</tr>
</table><br>
</div>
<div id="footer">Copyright©2004 R.M. Singh</div>
</form>
</body>
</center>
</html>