ASP/VBScript Form Help

H

hermand

I've got an online job application I am building using ASP/VBScript.
The application consists of one ASP document which has three separate
states.

States:

1. Form Display
2. Form Review (takes all information submitted from the first form
state and removes the form elements and displays entered information
using "Response.form()".
3. Displays "Thank You" page and emails form contents to a specific
email.

I am using Session variables to control the states of the form. So on
the first state, I set a Session variable (frmState) to "two" and the
second state sets the Session variable to "three". So, my ASP document
has an if/else statement controlled by the value of the Session
variable "frmState".

The issue I am having is if a user sees a mistake during the second
form state, they must click the "Back" button to return to the firsts
form state. However, the value of Session variable frmState is still
set for "three" which once the user re-submits the form, the second
form state is skipped and the third "Thank You" form state is displayed
and the user doesn't get a chance to re-check their inputted
information.

How can I setup the form (using VBScript) to reset the value of the
Session variable once the "Back" button is clicked?
It doesn't look like the ASP page is refreshed in any way, so the
Session variable always contains the wrong value.

Any help would be greatly appreciated.

--Dan

NOTE: This question was previously posted on "asp.net", but the amount
of answered questions at "asp.net" are much lower the here. :)
 
P

Paxton

hermand said:
I've got an online job application I am building using ASP/VBScript.
The application consists of one ASP document which has three separate
states.

States:

1. Form Display
2. Form Review (takes all information submitted from the first form
state and removes the form elements and displays entered information
using "Response.form()".
3. Displays "Thank You" page and emails form contents to a specific
email.

I am using Session variables to control the states of the form. So on
the first state, I set a Session variable (frmState) to "two" and the
second state sets the Session variable to "three". So, my ASP document
has an if/else statement controlled by the value of the Session
variable "frmState".

The issue I am having is if a user sees a mistake during the second
form state, they must click the "Back" button to return to the firsts
form state. However, the value of Session variable frmState is still
set for "three" which once the user re-submits the form, the second
form state is skipped and the third "Thank You" form state is displayed
and the user doesn't get a chance to re-check their inputted
information.

How can I setup the form (using VBScript) to reset the value of the
Session variable once the "Back" button is clicked?
It doesn't look like the ASP page is refreshed in any way, so the
Session variable always contains the wrong value.

Any help would be greatly appreciated.

--Dan

NOTE: This question was previously posted on "asp.net", but the amount
of answered questions at "asp.net" are much lower the here. :)


You can't use ASP to detect client-side events, such as button clicks,
but you could use hidden fields in the form to keep track of which
state it's in, rather than session variables.

That way, if someone does use their back button, when they resubmit the
form, it will be back to frmState="1".

Or, when you display the preview of what they are submitting, you could
also provide them with the form again, with the values from the
previous form already written to it so they can choose to submit again
or edit.

/P.

/P.
 
H

hermand

I guess it just takes another perspective to point out the obvious.
Success at last and thanks a bunch!

--Dan
 
P

paul

Or you could include a Back button on your page that submits to the
page again. And toward the top of the page check to see if the Back
button is <> "" and then adjust the session variable accordingly.

And for a semi-related link about checking to see what button was
clicked on:

Classic ASP Design Tips - Post Back Page
http://www.bullschmidt.com/devtip-postbackpage.asp

Best regards,
-Paul
www.Bullschmidt.com - Freelance Web and Database Developer
www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top