PDA

View Full Version : No idea how to do this - help requested


jeffmg279672
10-13-2009, 08:49 AM
I have a problem with a conference registration form which I'm not sure how to overcome. I've set up many of these for a client, using a form on an HTML page which then posts to an ASP page which emails the form data to the client as an email, then redirects to a thanks page. So far, so straightforward. This time round, the client has decided he wants something different - the plan is to run 3 conferences next year, and depending on whether the viewer selects more than one conference, a different level of discount applies.
So, for example, if you book one conference, this needs to trigger a message (presumably a hidden field) saying: You've selected 1 conference at a cost of £xx.
Booking two conferences (either 1+2, 1+3 or 2+3) should trigger a message saying:
You've selected 2 conferences at a cost of £yy - that's a saving of £zz (a bb% discount)
Booking all three conferences should trigger a message saying:
You've selected all 3 conferences at a cost of £zz - that's a saving of £xy (a cc% discount).

I'd thought of trying to do this with javascript but have been persuaded that it won't be much use if the viewer has his/her javascript disabled in the browser. If it was just a choice of 1, 2 or 3 checkboxes I assume it would be fairly straightforward, but as there are 3 permutations for choosing two conferences, I'm a bit flummoxed.
If anyone has any idea of a simple way of achieving this, or has done something similar, I'd really love to hear about it. Thanks in advance!

Eric Mittman
10-14-2009, 11:17 AM
This is really a custom solution and I won't be able to give very extensive advice but I think you could do this all server side by having the checkboxes on the event registration page.

This page would need to be an asp page or post to one that you have control of. On the page that the form posts to you can just do some simple checks for each of the three checkboxes. If any one of them is checked then an extra amount can be added to an amount variable.

You would then just use this variable in the email message to indicate the price.

To get it to show in the browser as the user makes the selection you would need to use some client side js for this. You can do something similar where you have an amount variable and accumulate the value based on the checkboxes. You can then write this value to a div that displays the price.

This is just a high level overview and is not something that would be supported since it is custom development. I hope this gives you a better idea of how something like this can be achieved.

phil
10-14-2009, 01:44 PM
This solution may not be for you but I would use a flash component to do the math and show a response, then push the total sum through to the next php page invisible via flashvars.

Like javascript, flash wont be installed on EVERY users machine but the number left out is so small I deem it as insignificant.

I am a pretty experienced flash developer though so have a natural tendancy to gravitate towards it for calculations and dealing with these kind of scenarios. You could build a pretty polished component to highlight the options the user has and display their benefits etc, and do it pretty quickly.