Have an account? Sign in
Login  Register  Facebook
How to calculate sum of form fields
Hello,

I wanted to ask if anyone knows a good tutorial that I can cretae an invoice system using javascript/ajax, php and mysql??

Basically I will have a webpage with a form.

Client Name (Dropdown box) from MySQL table.

On the form I will have about 15 rows with 4 columns

Products Qty Price Each Line Total
Item 1 1 £10 £10
Item 2 5 £5 £25
Item 3 2 £25 £50

Then at the bottom

Sub-Total
Tax
Total

Once the items are entered the Line Total, Sub-Total, Tax and Total need to be automatically calculated using javascript or ajax.

I only want the rows with products entered to be entered into the dtabase with the totals. All empty rows are to be ignored and not entered into database or if that cannnot be avoided not to show on order page. Only rows with products and costs to show.

I know this is a big task but I only want to be pointed to a tutorial please that will help me achieve this.

Thank you
Started: October 18, 2011 Latest Activity: October 18, 2011 PHP Mysql Ajax

You can't find one tutorial for all that you need. You have to know how to create these tasks one by one. Ofcource and you can find one by one some of the tasks you need, but now all together as one tutorial, as that tutorial it self it will be a book ! :) ;)
October 18, 2011

1 Answer
down vote
accept
For Total, Sub-Total, Tax and Total calculation you would need to call a function that would retrieve the values from the the form 's nodes and does the calculation.

Take a look at here

Posted: Dina
In: October 18, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer