refreshing a value output in a frame from a a ses. var.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vasilis
Forum Commoner
Posts: 40
Joined: Tue Apr 22, 2003 7:37 am

refreshing a value output in a frame from a a ses. var.

Post by vasilis »

Hey, people. :)
I have built a shopping cart in a 3 frame site which works with a session variable which is an array that holds among others the number of items selected for purchase and the total price of these items. On the left frame of the site there are two text output fields ( "no of items" and "total price") so the visitor is able to view his cart contents all the time while he is browsing in the main frame. On the main frame the visitor adds the products to his shopping cart. I want the text output fields in the left frame to refresh whenever the cart values change, e.g. when the visitor adds a new product to his cart, the values in the left frame should also refresh. I guess, I do that with Javascript. If yes, is there some code for that job? I have already used a OnClick event handler which uses the reload() Javascript method for reloading the left frame. The problem with this method is that the left frame reloads BEFORE the cart session variable updates its values, and therefore, the text fields still show the previous cart values and not the new ones.
I appreciate any help
Post Reply