can anyone give me a javascript that can do following.
I have predefined price for a product (lets say A). the consumer can select the quantity (lets say B)for that product. and the total price(lets say C where C=A*B) shows up on the same page without him actually pressing any button.
If there are 5 different products he chose then at the bottom the total price (“C”) for each product adds up automatically (lets say D)at the bottom. (i will use this total price (“D”) by passing it into a header command of php on some other page).
I know html and css and a little php but i have no idea of javascript. I am making this website for a book store . The owner is a real good friend and i want to make it the best i can. Thanks for your help
for example
this is what i want to happen. i am selling 5 different books on the same page. you can select the books you want and the quantity of each book. ( for example 3 books of type 1 and 2 books of type 2). At the bottom of the page the calculation occurs automatically and the buyer can see the total amount he has to pay
can anyone give me a javascript that can do following. I have predefined price
Share
I suggest looking at:
http://www.w3schools.com/jsref/event_onchange.asp
http://www.w3schools.com/js/js_obj_math.asp
And
http://www.w3schools.com/ajax/default.asp
The final one is more complex, and is for the dynamic post to the PHP file. Before asking for the code from someone else, try your hardest to see if you can learn to do it yourself… it’ll count in the long run.