Forum Moderators: coopster

Message Too Old, No Replies

PHP Form Question

         

wfernley

7:20 pm on Jun 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello.

I am working on a shopping cart right now and I am trying to make the user able to edit the quantity of each product.

Currently, I have a table that shows the product name, price, quantity (which is in an input textfield) and final price (which is the quantity X price).

I was curious how I can make it so I can have them enter a new number in the quantity field and it will automatically update the final price.

I hope I explained my problem well :)

Thanks.

Wes

Birdman

8:31 pm on Jun 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,

This just came up not long ago.

How can i auto submit a POST form [webmasterworld.com]

coopster

8:34 pm on Jun 29, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Before it goes back to the server? That would be a client-side scripting language such as javascript [webmasterworld.com].

On the server side, you simply receive the "update price" posted form and calculate the new price and redisplay the form.

Even if you show it on the client-side, you'll want to calculate the update on the server-side and make sure it is correct/accurate since information such as this could be modified outside of your control on the client-side.