I'm building a very small web ERP application with PHP / mySQL / CodeIgniter / jQuery
The Bill/Invoice is built with
current date
client data
etc
Now, I must add products to that new invoice that is being created, without reloading/submitting the page. Each product will have its qtty., description, unit price, subtotal, etc.
I'd like to add each product "row" using Ajax/jQuery.
- How should I build the products form dynamically? I mean, allowing users to add a new product row, or remove product rows from invoice, using Ajax?
- How to sum all the dinamically added "rows" in the form, for getting invoice total?
- And how should I receive and treat all the post data so I can insert the proper invoice record in the invoices table and insert the products records into the products_invoices table?
Thanks a lot. Hope you've understood my question.
EDIT: here you can see a working example of what I want to do
http://www.bambooinvoice.org/index.php/invoices/newinvoice
EDIT2: This jQuery plugin seems to be what I was looking for
http://code.google.com/p/jquery-dynamic-form/