Hi all,
I'm putting together a form with a simple math routine in it - however the multiply function gets me - I cant seem to get it right - any ideas on where I'm going wrong?
I'm putting together a form with a simple math routine in it - however the multiply function gets me - I cant seem to get it right - any ideas on where I'm going wrong?
Code:
<HTML>
<HEAD>
<script language="javascript">
// # START "SIMPLE TEXT BOX NUMBER ADDITION" SCRIPT # -->
// this first two parts seem to work. -->
function calcFnl()
{
shipping = document.frmCalculate.shipping.value
shipping = Number(shipping)
Total_Price_to_be_Paid = document.frmCalculate.Total_Price_to_be_Paid.value;
Total_Price_to_be_Paid = Number(Total_Price_to_be_Paid)
Total = (shipping+Total_Price_to_be_Paid)
document.frmCalculate.trb.value = Total
// here is the muliply part. -->
volume = document.frmCalculate.volume.value
volume = Number(volume)
rslt = document.frmCalculate.rslt.value
rslt = Number(rslt)
Final = (trb*volume)
document.frmCalculate.rslt.value = Final
}
// # END "SIMPLE TEXT BOX NUMBER ADDITION" SCRIPT # -->
</script>
</HEAD>
<BODY>
<form name="frmCalculate">
<input name="shipping" type="text" class="textField" onChange="calcFnl()" size="6" maxlength="5">
+</input>
<input name="Total_Price_to_be_Paid" type="text" class="textField" onChange="calcFnl()" size="6" maxlength="7" >
=
</input>
<input type="text" size="7" name="trb" maxlength="7" class="textField" onChange="calcFnl()">
</input></input>
</input>
times
<input name="volume" type="text" class="textField" id="volume" onChange="calcFnl()" size="6" maxlength="7" >
is =
<input name="rslt" type="text" class="textField" id="rslt" onChange="calcFnl()" size="6" maxlength="7" >
</form>
</BODY>
</HTML>