If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

need to auto sum form

Ok so I'm about as green as they come when it comes to JavaScript so pardon my ignorance. I've searched on this for a couple weeks trying to figure it out on my own with no success so I'm seeking some assistance here.
I have a form that has multiple input fields that I need to total up. Here is the form, http://jemtechnv.com/portal/beta/finish_ticket.php I know it looks jacked up but I'm working on it, so looking at the form you see I have a field named Qty and a field named Price. I need to multiply those together and populate the Ext field I then need to total up the Ext field and populate the Material Total field, I can total the Ext field currently as you can see if you enter a number in each box of the Ext field you will see the sum total in the Material Total box. My issue is not being able to get the Qty and the Price fields to total up and populate the Ext box. This is the code I'm using to sum up the Ext fields that is working:

my only problem with this is if I have more than 5 fields it wont work unless I change < =5; to the number of fields.

I also need to be able to multiply the rate by the hours and populate the total fields as well and you guessed it total all those up for the grand total as well. I'm not looking for someone to write an entire script for me I just need some assistance on finding a script to do what I need or some help with tweaking what I'm using. Thanks in advance!

Thanks for the reply vwphilips but I'm a bit lost, I replaced my code with what you posted and I get the same thing I had, I only get the values for the ext column to total up and populate the material total box. I can change the values in my script and have it total up one qty box and one price box and get it to populate the ext box but it add's and I need those fields multiplied and that's all I can get it to do. I can't seem to get more than one row to work.

Basically this is what I am trying to accomplish, I have my script to sum up all the Ext column and auto populate that total in the Material total box what I can't figure out is how to write the code to take what is in the Qty box and Price box of row 1 and multiply it and auto populate the Ext box for row 1 then do the same for the Qty and Price boxes for the remaining rows and have the values of each rows Ext box auto populate the Material Total box. Can I use multiple 'while' statements with different .getElementById values?

Answering my own issue it seems, but I'm stuck again.
So here is what I have so far, I have managed to get the Qty and Price for each row to auto populate the Ext for the related row,
so on row 1 I enter an amount for Qty and it populates the same number in the Ext box, I add a number to row 1 price and it adds that number to the Qty and changes the number in the row 1 Ext box. I can move on down to row 2,3, 4 and 5 with the same results. but my problem is that it's adding and I need it to multiply. here is my code:

one other thing as well, I changed the last line of code for sales tax from .value=t/10 to .value=t*8.10 to get the correct sales tax rate and it gives the correct rate but too many decimal points over. instead of 5.83 it's 583.199