Using HTML to create a purchase order with user input

Using a form to create a purchase order.
I need 15 line items with the ability to multiply 2 user fields to get a sub total for each line.
Then also automatically total all 15 lines.
I have tried several scripts but can seem to make a loop work.