How to multiply two numeric values inside a browser (to calculate prices) without actually refreshing page? [closed]
My brother has a grocery store. He asked me that if I could create a website to order grocery online so he could get it home delivered.
I know HTML, CSS and a little PHP.
I wanted to ask if anyone would guide how to do calculations on a browser. Like if I am selling mangoes. I will show that price per unit weight. Than I will provide a drop down from where the buyer can choose weight. And just next to it the calculation will occur and he can get the total price he has to pay on the same page.
After that I know what to do.w开发者_如何学运维hen he presses submit I will take the total and pass it to confirmation page using header command in PHP .
Please note that I its pay on delivery site so I don't need a payment method.
You can take a look here , and I found this site which I believe is good for you as well to learn.
Why can't you just hook up a javascript event handler to the website's "calculate" or "update quantity" button for the given item and use javascript to calculate the cost for the items?
精彩评论