473,803 Members | 3,306 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP/VBScript Form Help

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
3 6184

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
I guess it just takes another perspective to point out the obvious.
Success at last and thanks a bunch!

--Dan

Jan 18 '06 #3
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2391
by: Dave Thomas | last post by:
I have developed a web site using asp pages that use both vbscript and javascript. Run the site on my PC and everything is fine. Ftp to my web hosting provider which hosts asp pages and look on my site only to find my vbscript is not recognised. It is treated as pure text so you see <% =Request.Form("LoginId") %>. Also see all the vbscript when you "View Source". I have e-mailed my host provider but thought this may be quicker! Any ideas...
3
1895
by: JWM | last post by:
Hello: Here is what I am trying to do...... The user clicks on the delete icon, and gets a JavaScript client-side popup to confirm that he wants to delete. I am passing this client-side function a contactID. Then, I want to send the result of this confirm (true|false) to a server-side VBScript function, along with the contactID. The VBScript function will then perform a delete in the database for the specified contactID.
2
2596
by: ChucRock | last post by:
Hi, I have the following code where there is some client side VBScript that does something and needs to pass a variable back to the ASP.NET page. When the page is updated through a postback, the information is lost. What am I doing wrong? After obtaining the variable, I assign it back to a Label text field on the form, it shows up on the web page no problem.
2
2852
by: Frank | last post by:
Can I do this? I add a session var in C# and ultimatly want to pass it into a vbscript client side activeX control. This is what I have so far but get " Object Required:'name2' " error. Can anyone suggest a btter way of passing a session var into a vbscript function? <%@ Page language="c#" debug="true" ContentType="text/html"
3
2984
by: Drwtsn32 | last post by:
Hi Guys, I'm ripping off all of my hair soon ;-) I'm trying to do a very simple C# form accessible from COM client like VBScript. I would like to display the form and update the form during the intepretation of the vbscript. Does anyone know of any good example that could point me to the right direction.
1
4226
by: JNariss | last post by:
Hello, I have created a connection to my Access database with Dreamweaver and made a simple form with 4 fields. The code behind this form was/is: <%@LANGUAGE="VBCRIPT" CODEPAGE="1252"%> <!--#include virtual="/Connections/EmployeeStatusChange.asp" --> <%
0
1107
by: Dino123 | last post by:
Hi I have a page written in VBScript, which uses values from a page posted to it, to send an e-mail. The problem is that when I try to specify a control within the page I get an error, saying "Object Required : Document". Here is a the code: <%@ Language=VBScript %> <% Dim szMail szMail = "<form id= SendAccounting name = SendAccounting language=VBScript>"&_ "<table>"&_
2
8519
by: moodyman13 | last post by:
Hi All, I’m in a bit of pickle with ASP and VBscript variable and hope someone could get me some advice. There’s a FORM’ I’ve created in ASP and its purpose is to capture the name(s) of users. The plan is then to pass the information from ASP to VBScript. My dilemma is how to extract the information in ASP and use it in VBScript. (Please see code below) I’ve read in some forums that is simply can’t be done. Unfortunately, I can’t run...
2
5521
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my results page. - Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code): SELECT * FROM db_name WHERE (db_field1 LIKE ‘%text1%’ OR db_field2 LIKE ‘%text2%’)
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.