ASP/VBScript Form Help

Discussion in 'ASP General' started by hermand, Jan 18, 2006.

  1. hermand

    hermand Guest

    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. :)
     
    hermand, Jan 18, 2006
    #1
    1. Advertising

  2. hermand

    Paxton Guest

    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.
     
    Paxton, Jan 18, 2006
    #2
    1. Advertising

  3. hermand

    hermand Guest

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

    --Dan
     
    hermand, Jan 18, 2006
    #3
  4. hermand

    Guest

    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, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Kershaw
    Replies:
    0
    Views:
    458
    Steve Kershaw
    Jul 18, 2007
  2. Replies:
    18
    Views:
    908
  3. Chester
    Replies:
    0
    Views:
    136
    Chester
    Jul 30, 2004
  4. Andrew Wan

    HELP: ASP JScript & VBScript interoperability

    Andrew Wan, Jun 15, 2007, in forum: ASP General
    Replies:
    1
    Views:
    139
    Anthony Jones
    Jun 15, 2007
  5. Replies:
    3
    Views:
    741
    Anthony Jones
    Jun 1, 2008
Loading...

Share This Page