re display form fields after refresh

Discussion in 'ASP General' started by Michael Minter, Sep 4, 2003.

  1. I'm just new at this so any help more than appreciated.

    I have created an email form in which all fields must be completed. If
    all the fields are not completed "submit" causes a refresh using
    response.redirect, Problem is allthe fields that were previously
    filled in are empty.

    How do I keep the values of the fields on refresh?


    Thanks in advance

    Michael Minter
    Michael Minter, Sep 4, 2003
    #1
    1. Advertising

  2. Michael Minter

    TomB Guest

    You have two choices.

    The first is to use two pages (which I'm assuming you are currently doing)
    the first page contains the form that the user fills out and posts to
    the second page
    the second page checks the values, and if ok sends the mail, if not
    returns to the first page.

    The second choice is to use one page (this is easier)
    the page is the same as the first page you've already created, but it
    posts to itself.

    In either case you need to pass the values entered by the user, back to the
    form.

    Using the first method, your response.redirect should contain a querystring
    with the values in it......
    Response.Redirect
    "Page1.asp?From=&To=&subject=
    whatever&body=blahblahblah"
    Then your input boxes would be constructed like.....
    <input name=To value="<%=Request.QueryString("To")%>">

    the only difference with the second method, is that you would construct your
    input boxes like
    <input name=To value="<%=Request.Form("To")%>">



    "Michael Minter" <> wrote in message
    news:...
    > I'm just new at this so any help more than appreciated.
    >
    > I have created an email form in which all fields must be completed. If
    > all the fields are not completed "submit" causes a refresh using
    > response.redirect, Problem is allthe fields that were previously
    > filled in are empty.
    >
    > How do I keep the values of the fields on refresh?
    >
    >
    > Thanks in advance
    >
    > Michael Minter
    TomB, Sep 4, 2003
    #2
    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. Bob
    Replies:
    1
    Views:
    647
  2. Bob
    Replies:
    0
    Views:
    484
  3. Matt Herson
    Replies:
    3
    Views:
    131
    Matt Herson
    Sep 30, 2003
  4. Pat Scott
    Replies:
    0
    Views:
    102
    Pat Scott
    May 24, 2004
  5. Replies:
    23
    Views:
    470
    Tim Streater
    Dec 18, 2013
Loading...

Share This Page