Hi again,
Sorry to say that it's returning an error: 'stack overflow at line: 43' I dont know why that is.... So just to try and simplify ill show you my entire code. This way you may see my problem and know forsure. Take care
DES
<code>
<HTML>
<head><title>INVOICE</title>
<link rel="stylesheet" href="stylesheet.css">
<script language="javascript">
function calculate(what){
what.prompt20.value = "0.07"
// Total ALL cells
what.prompt19.value = (what.prompt10.value - 0) + (what.prompt14.value - 0) + (what.prompt18.value - 0);
what.prompt20.value = (what.prompt19.value - 0) * (what.prompt20.value - 0 );
what.prompt21.value = (what.prompt19.value - 0) + (what.prompt20.value - 0) ;
}
function removeTax(what){
if(invoice.noGst.checked){
invoice.prompt20.value="0";
what.prompt21.value = (what.prompt19.value - 0) + (what.prompt20.value - 0);
}
else invoice.prompt20.value = 0.07;
}
function subtract(what){
//subtract
what.prompt23.value = (what.prompt21.value - 0) - (what.prompt22.value - 0);
}
</script>
<script language="javascript">
String.prototype.toArray = function(){
var charAr = new Array();
for(var i = 0;i < this.length;i++){
charAr = this.charAt(i);
}
return charAr;
}
//reverse function for strings. included for the currency function.
String.prototype.reverse = function(){
var str, charAr;
charAr = new Array();
charAr = this.toArray();
charAr = charAr.reverse();
str = charAr.join(""

;
return str;
}
//function to turn a number into a formatted string in US currency format.
Number.prototype.toUSCurrency = function(){
var str, dec, x, y;
str = Math.round(this * 100)/100;
str = new String(str);
dec = (str.indexOf("."

> -1)?str.split("."

[1]:"00";
str = (str.indexOf("."

> -1)?str.split("."

[0]:str;
x = str.length;
str = str.reverse();
y = "";
for(var i = 0; i < x; i++){
y += (i%3 == 0 && i != 0 && i != x)?",":"";
y += str.charAt(i)
}
y = y.reverse();
return "$"+y+"."+dec;
}
function add(field1, field2, field3){
var x = parseInt(field1.value);
var y = parseInt(field2.value);
var z = x + y;
field3.value = z.toUSCurrency();
}
</script>
</head>
<body width="600" onLoad="document.invoice.prompt0.focus()">
<table width="100%" bgcolor="#000000" >
<tr>
<td width align class="white">INVOICE</td>
</tr>
</table>
<BR><BR>
<img src="dropShadow.gif" border="0" align="right">
<FORM name="invoice" action method="post" onSubmit>
<table width="500" align="left" border="0" cellpadding="1" cellspacing class="tiny">
<tr>
<td width="100"><B>Invoice Number:</b></td>
<td width="" align><input type="text" name="prompt0" ></td>
</tr>
<tr>
<td width><b>Member Number:</b></td>
<td width align><input type="text" name="prompt1"></td>
</tr>
<tr>
<td width ><b>Date:</b></td>
<td width align><input type="text" name="prompt2"><script language="Javascript">
var today = new Date()
var month = today.getMonth() + 1
var day = today.getDate()
var year = today.getFullYear()
var s = "/"
document.invoice.prompt2.value = month + s + day + s + year
</script></td>
</tr>
<tr>
<td width="" align valign="top"><b>To:</b></td>
<td width align valign><textarea cols="35" rows="5" name="prompt3"></textarea></td>
</tr>
</table>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<HR>
<BR>
<table width="600" align cellpadding cellspacing="5" class="small">
<TR>
<td width="300" align><b>Invoice Date:</B></td>
<td width align><input type="text" size="20" name="prompt4"></td>
</tr>
<tr>
<td width align valign="top"><b>Invoice Issued By:</B></TD>
<td width align><select multiple width="" size="1" name="prompt5">
<option name="CEO">CEO (Dan Stapleton)
<option name="Reg">Registrar (Carole Farr)
<option name="Dir1">Director, Finance & Administration (Janet Crofton)
<Option name="Dir2">Director, Events & Sponsorships (Marta Pawych)
<option name="Comm">Director, Communications (Beverley, Allen)
<Option name="AR">Assistant Registrar (Peter Ruggiero)
<option name="Ops">Operations Manager (Katia Tam)
<option name="Fin">Finance Manager (Gary Monk)
<option name="IT">I.S. Manager (Nick Gao)
<option name="PRM">Project Manager (Alicia Tessier)
<option name="DCO">Member Services Associate (Kim Kuan)
<option name="Rec">Reception (Pat Collins)
<option name="mem">Membership Coordinator (Arlene Herscheid)
<option name="EA">Executive Assistant (Louise Tagliacozzo)
<option name="chp">Chapter Relations Coordinator (Lesley Henderson)
<option name="Pro">Programs & Exhibits Coordinator (Sherrydawn Warren)
<option name="Eve">Events & Sponsorships Assistant (Carla Leszkowicz)
<option name="res">Resource Center Supervisor (Gina Matesic)
<option name="re">Resource Center Supervisor (Helena Merrian)
<option name="CO">Communications Associate (Jennifer Noddle)
<option name="Se">Senior Writer, Managing Editor, HR Professional (Kathleen Rowlands)
<option name="Adm">Administrative Assistant (Catherine Thomas-Keating)
<option name="Acc">Accounting Coordinator (David Ward)
<option name="eap">P.S.C. - Evening Academic Programs (Margaret Carter)
<option name="cert">P.S.C. - Certification (Beth Dennis)
<option name="pm">P.S.C. - Membership (Duane McKenzie)
<option name="cpe">P.S.C. - C.P.E. (Kelly Morris)
</select>
</td>
</tr>
<tr>
<td width align><B>Tax Registration #:</B></TD>
<td width align><input type="text" size="20" name="prompt6" value="R104154273"></td>
</tr>
</table>
<br>
<br>
<br>
<TABLE WIDTH="650" BORDER="0" ALIGN="center" CLASS="tiny">
<TR>
<TD WIDTH="100" ALIGN="center" VALIGN BGCOLOR="#F1F1F1"><b>Unit</b></td>
<TD WIDTH="300" ALIGN="center" VALIGN BGCOLOR="#F1F1F1"><b>Description</b></td>
<TD WIDTH="150" ALIGN="center" VALIGN BGCOLOR="#F1F1F1"><b>Unit Price</b></td>
<TD WIDTH="100" ALIGN="center" VALIGN BGCOLOR="#F1F1F1"><b>Total</b></td>
</TR>
<TR>
<TD WIDTH ALIGN="center" VALIGN><INPUT TYPE="text" NAME="prompt7" onKeyUp="this.form.prompt10.value = (this.form.prompt7.value - 0) * (this.form.prompt9.value - 0);calculate(this.form);dollarize(this.form)" size="10"></TD>
<TD WIDTH ALIGN="center" VALIGN><input type="text" name="prompt8" size="30" value></td>
<TD WIDTH ALIGN="center" VALIGN>$<INPUT TYPE="text" NAME="prompt9" onKeyUp="this.form.prompt10.value = (this.form.prompt7.value - 0) * (this.form.prompt9.value - 0);calculate(this.form)" size="10"></TD>
<TD WIDTH ALIGN="center" VALIGN>$<input type="text" name="prompt10" size="10" READONLY> </td>
</TR>
<TR>
<TD WIDTH ALIGN="center" VALIGN><INPUT TYPE="text" NAME="prompt11" onKeyUp="this.form.prompt14.value = (this.form.prompt11.value - 0) * (this.form.prompt13.value - 0);calculate(this.form)" size="10"></TD>
<TD WIDTH ALIGN="center" VALIGN><input type="text" name="prompt12" size="30" value></td>
<TD WIDTH ALIGN="center" VALIGN>$<INPUT TYPE="text" NAME="prompt13" onKeyUp="this.form.prompt14.value = (this.form.prompt11.value - 0) * (this.form.prompt13.value - 0);calculate(this.form)" size="10"></TD>
<TD WIDTH ALIGN="center" VALIGN>$<input type="text" name="prompt14" size="10" READONLY> </td>
</TR>
<TR>
<TD WIDTH ALIGN="center" VALIGN><INPUT TYPE="text" NAME="prompt15" onKeyUp="this.form.prompt18.value = (this.form.prompt15.value - 0) * (this.form.prompt17.value - 0);calculate(this.form)" size="10"></TD>
<TD WIDTH ALIGN="center" VALIGN><input type="text" name="prompt16" size="30" value></td>
<TD WIDTH ALIGN="center" VALIGN>$<INPUT TYPE="text" NAME="prompt17" onKeyUp="this.form.prompt18.value = (this.form.prompt15.value - 0) * (this.form.prompt17.value - 0);calculate(this.form)" size="10"></TD>
<TD WIDTH ALIGN="center" VALIGN>$<input type="text" name="prompt18" size="10" READONLY> <hr> </td>
</TR>
<TR>
<TD COLSPAN="2"></TD>
<TD width align="right">SUBTOTAL</TD>
<TD width ALIGN="center">$<INPUT TYPE="text" name="prompt19" size="10" READONLY></td>
</TR>
<TR>
<TD COLSPAN="2"></TD>
<TD width align="right" >GST</TD>
<TD width ALIGN="center">$<INPUT TYPE="text" name="prompt20" value="" size="10" READONLY></td>
<TD width align="center"><input type="checkbox" name="noGst" value onClick="removeTax(this.form); dollarize()"></td>
</TR>
<TR>
<TD COLSPAN="2"></TD>
<TD width align="right" >TOTAL</TD>
<TD width ALIGN="center">$<INPUT TYPE="text" name="prompt21" size="10" READONLY></td>
</TR>
<TR>
<TD COLSPAN="2"></TD>
<TD width align="right" >Less Amount Received</TD>
<TD width ALIGN="center">$<INPUT TYPE="text" name="prompt22" size="10" onKeyUp="this.form.prompt23.value = (this.form.prompt21.value - 0) - (this.form.prompt22.value - 0); subtract(this.form); toUsCurrency(this.form)" ></td>
</TR>
<TR>
<TD COLSPAN="2"></TD>
<TD width align="right" ><B>BALANCE DUE</B></TD>
<TD width ALIGN="center">$<INPUT TYPE="text" name="prompt23" size="10" READONLY></td>
</TR>
</table>
<br><button onclick="add(prompt19, prompt20, prompt21)">add()</button>
<br>
<br>
<input type="submit" name="submit" value="View Report">
<br>
<br>
<br>
</form>
</body>
</HTML>
</code>