Mark (mhaithaca) wrote,
Mark
mhaithaca

Can anyone offer my friend Terry some advice?

Not sure if you write JavaScript or not, or if you know of someone I can talk to who DOES, but I'm working on a new site for Project Puffin and unfortunately for me, it is due tomorrow, and Audubon was going to write some code for me, but apparently they are having trouble doing what my boss asked for, so I wanted your advice on whether this is even POSSIBLE before I proceed any further (and possibly waste time).

I am trying to figure out how to get a web site page (see attached) to do a couple of things.

Basically, I need to write scripts to do the following two things:

1. Validate that ALL fields contain an answer BEFORE allowing user to submit form.

2. Validate ALL answers chosen, and THEN send the user to the next appropriate page (see below).

The first question we ask is just a yes or no, and we just need to record/store which they chose. That part doesn't have anything to do with how to redirect people to the next page.

BUT, the other questions are more crucial because they would decide which page people go to next, and the results should be as follows:

IF they choose PPVC AND Adopt-A-Puffin, THEN they should be redirected to:
https://loon.audubon.org/payment/donate/fulfill/PUFADT-VC.html


IF they choose PPVC AND Donation (Standard), THEN they should be redirected to:
https://loon.audubon.org/payment/donate/fulfill/PUFDON-VC.html


IF they choose PPVC AND Donation "In Honor Of", THEN they should be redirected to:
https://loon.audubon.org/payment/donate/fulfill/PUFHON-VC.html


IF they choose PPVC AND Donation "In Memoriam", THEN they should be redirected to:
https://loon.audubon.org/payment/donate/fulfill/PUFMEM-VC.html




IF they choose OTHER AND Adopt-A-Puffin, THEN they should be redirected to:
https://loon.audubon.org/payment/donate/fulfill/PUFFINADT.html

IF they choose OTHER AND Donation (Standard), THEN they should be redirected to:
https://loon.audubon.org/payment/donate/fulfill/PUFFINDON.html


IF they choose OTHER AND Donation "In Honor Of", THEN they should be redirected to:
https://loon.audubon.org/payment/donate/fulfill/PUFFINHON.html


IF they choose OTHER AND Donation "In Memoriam", THEN they should be redirected to:
https://loon.audubon.org/payment/donate/fulfill/PUFFINMEM.html



Regarding the choices when the page first loads, I purposefully did not choose any responses to be the default, because I don't want some people just clicking through without really having to choose where they heard about the project or what kind of donation they are making - I want them to HAVE to choose.

I've been wanting to learn this stuff, and have been searching the net, but I am not having much luck. I think that I just need to come up with some kind of "if.....else" coding, I've just never done it.
Am I doing things the hard way, or overlooking a simple solution?
They did not want more than one interim page, so I am trying to figure this out.

Any advice? In the meantime I will keep on searching the 'Net for possible solutions.
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 6 comments