Thread View: adobe.golive.dynamic.content
2 messages
2 total messages
Started by Susan_van_der_Poll
Sat, 14 Aug 2004 09:48
calculate question
Author: Susan_van_der_Poll
Date: Sat, 14 Aug 2004 09:48
Date: Sat, 14 Aug 2004 09:48
6 lines
1217 bytes
1217 bytes
I have a simple php form page to order tickets online via an email being set to the box office. It draws the information of performance, date, type of ticket and prices from an SQL database. So far so good. But I want customers to be able to total up their order. The problem is that there are 16 different ticket types and I have it only showing the ticket types and prices relevant to that performance. No performance uses more than 8, and some only two. Javascript is not working because some times the number of elements on the pages change. Any ideas anyone? Thanks Susan
Re: calculate question
Author: Oliver_Michalak
Date: Sat, 14 Aug 2004 10:27
Date: Sat, 14 Aug 2004 10:27
11 lines
1398 bytes
1398 bytes
As a general recommendation move all you data processing to the server. For that reason most shops offer an 'update basket' feature which calls the page itself to be updated on the server and return the result back to the user. But even if you want to do it on the client side: of course you can write Javascript code to fetch different amount of data to work on. In javascript, you can acess forms and elements inside a form, count them and query the individual values. That way the Javascript will 'adopt'. Or you can let PHP write a Javascript variable to the counter of tickets, like < script > var counter = <?=$number_of_tikets?>; for (var idx=0; idx<counter; idx++) // process form elements here < /script> I have done both with success...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads