javascript calculation total not working
-
I can't get the Total box to calculate. I am trying to create an online invoice for my customer to print from my webpage. I have scoured the internet looking for some help, but it doesn't help that I am clueless about javascript. This is what I have tried: In my table, all I want to happen is for the user to type in a price in the Amount boxes and then have a total at the bottom. Seems pretty basic, but I just don't understand why it won't work (not really sure of what I am doing) Can somebody please help me? The form itself can be found at www.ahtcsonline.com/invoice.html Thank you in advance, Evan <script type="text/javascript"> function totalamountdue(){ { var amount, amount2, amount3, amount4, amount5, amount6, amount7, amount8, amount9, amount10; Amount = document.Invamt.Amount.value; Amount2 = document.Invamt.Amount2.value; Amount3 = document.Invamt.Amount3.value; Amount4 = document.Invamt.Amount4.value; Amount5 = document.Invamt.Amount5.value; Amount6 = document.Invamt.Amount6.value; Amount7 = document.Invamt.Amount7.value; Amount8 = document.Invamt.Amount8.value; Amount9 = document.Invamt.Amount9.value; Amount10 = document.Invamt.Amount10.value; Total = document.Invamt.Total.value; document.Invamt.Total.value = (amount + amount2 + amount3 + amount4 + amount5 + amount6 + amount7 + amount8 + amount9 + amount10); } } </script> </head> <table width="738" border="1"> <tr class="Title-centered"> <td width="214" align="left"><div align="center"><strong>Name of Attendee</strong></div></td> <td width="229"><div align="center"><strong>Description</strong></div></td> <td width="118"><div align="center"><strong>Amount</strong></div></td> </tr> <tr> <td><div align="center"><span class="style15"> <input name="name" type="text" class="Input_box" id="name" size="40" /> </span></div></td> <td><div align="center"><span class="style12"> <select name="select_class" class="Input_box" id="select_class"> <option selected="selected">--Select a Class-- </option> <option>TRACS 202c</option>
-
I can't get the Total box to calculate. I am trying to create an online invoice for my customer to print from my webpage. I have scoured the internet looking for some help, but it doesn't help that I am clueless about javascript. This is what I have tried: In my table, all I want to happen is for the user to type in a price in the Amount boxes and then have a total at the bottom. Seems pretty basic, but I just don't understand why it won't work (not really sure of what I am doing) Can somebody please help me? The form itself can be found at www.ahtcsonline.com/invoice.html Thank you in advance, Evan <script type="text/javascript"> function totalamountdue(){ { var amount, amount2, amount3, amount4, amount5, amount6, amount7, amount8, amount9, amount10; Amount = document.Invamt.Amount.value; Amount2 = document.Invamt.Amount2.value; Amount3 = document.Invamt.Amount3.value; Amount4 = document.Invamt.Amount4.value; Amount5 = document.Invamt.Amount5.value; Amount6 = document.Invamt.Amount6.value; Amount7 = document.Invamt.Amount7.value; Amount8 = document.Invamt.Amount8.value; Amount9 = document.Invamt.Amount9.value; Amount10 = document.Invamt.Amount10.value; Total = document.Invamt.Total.value; document.Invamt.Total.value = (amount + amount2 + amount3 + amount4 + amount5 + amount6 + amount7 + amount8 + amount9 + amount10); } } </script> </head> <table width="738" border="1"> <tr class="Title-centered"> <td width="214" align="left"><div align="center"><strong>Name of Attendee</strong></div></td> <td width="229"><div align="center"><strong>Description</strong></div></td> <td width="118"><div align="center"><strong>Amount</strong></div></td> </tr> <tr> <td><div align="center"><span class="style15"> <input name="name" type="text" class="Input_box" id="name" size="40" /> </span></div></td> <td><div align="center"><span class="style12"> <select name="select_class" class="Input_box" id="select_class"> <option selected="selected">--Select a Class-- </option> <option>TRACS 202c</option>
The Web Development forum might be a better place for this.
-
The Web Development forum might be a better place for this.