I hope one of you javascript experts can help me out on this one. In html and PHP I made a purchase script. Al the products are listed inside a WHILE loop. The problem is, when I POST it starts entering data in the database. I would like the possibility that when I enter a number in the "aantal" field that it instantly calculates live how much it is going to cost.
So, "aantal$i" * inkoop_prijs = Subtotal
And, all Subtotals together = Total
Thanks for your help so far, really appreciate it and that's really some amazing script you posted there, it does calculate immediately when you enter a number in the field "aantal".
But the WHILE loop, looks up all products in my database and then lists it.
So when I open up the page there is more then 1 product listed.
The moment where I get a "NaN" error is when I insert a number in 2 different "aantal" fields. It automatically takes the latest inserted value and only calculates with that number, it doesn't add the previously entered number.
Hope you can help me with this one.
Thanks in advance.
Bookmarks