Calculate each row and then total

I am making what I call a PM (Preventive Maintenance) Kit list. My users will use this list to generate a printable sheet to tell me what they used out of there kit. The list includes pricing per part and I would like the list to calculate the costing as they enter each item. So a total per line and an overall total cost.

I have included a snap shot of the page and below is the code.
I can do this sort of thing on a small scale with just adding two lines but I am not sure how to modify it to handle this scale. You can see the script towards the bottom of the page. That is my lame attempt to make the per line costing happen but NOTHING happens.

Thank you for looking urtrivedi but that does not help in my case. In that link all of the info is already in the database and only php code is needed. My problem requires users to enter the qty needed so javascript is required.
Thank you for trying.
Ken

This is the javascript placed inside of the php while loop that generates the table.
This scripts calculates the extended total of each row in the table
So Part x is $5 dollars. User enters 10 and it puts $50 in the total column.

This was hard to figure out for a beginner like me. The script is used to total all of the column totals.
Most of it came from here
I had to change it to look inside a text box rather than inside the td of the table.
I also added the replace to remove the "$" sign.
Ken