By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,696 Members | 2,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,696 IT Pros & Developers. It's quick & easy.

ASP/VBScript Form Help

P: n/a
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. :-)

Jan 18 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

hermand wrote:
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.

Jan 18 '06 #2

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

--Dan

Jan 18 '06 #3

P: n/a
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

Jan 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.