Hidden input Form , response.write not working

Discussion in 'ASP General' started by chumley, Mar 4, 2010.

  1. chumley

    chumley Guest

    I have a javascript history object (javascript:history.go(-1)) that
    goes back to previous page when I trigger a button event to go back to
    that last page :
    <form action="javascript:history.go(-1)" method="post">
    <input type="hidden" value="yes" name="awc" id="awc">
    <input type="submit" value="BACK">
    </form>

    ...but doing a test to response write to see if it's posting to the
    previous page:
    if request.form("awc") = "yes" then
    response.write "yes "'
    end if

    ....I do not see the "yes" displayed. wondering if combining this
    javascript object with this simple ASP is valid, tho it looks like it
    should be. Even doing method="get" , I don't get my "yes" display :-(

    ??
    chumley
     
    chumley, Mar 4, 2010
    #1
    1. Advertisements

  2. chumley

    Dooza Guest

    Your page won't submit the form data, as your using Javascript to
    effectively press the back button. I would use a session variable on the
    previous page, call it previous page. Define it as
    Request.ServerVariable("SCRIPT_NAME"), then set your action to your form
    as the session variable.

    Dooza
     
    Dooza, Mar 5, 2010
    #2
    1. Advertisements

  3. Gazing into my crystal ball I observed chumley <>
    writing in :
    ASP has no idea about what's happening on the client, so would never get
    that information.

    By the way, you're reinventing the wheel. There is a back button on the
    user's browser, as well as a handy dandy backspace key that does the same
    trick, not to mention the mouse gesture, should the client be so enabled.

    There is another suggestion in this thread about using session variables.
    That can work, but I prefer to explicitly state the name of the file for
    the action attribute, or better yet, have the form submit to itself.

    YMMV
     
    Adrienne Boswell, Mar 5, 2010
    #3
  4. chumley

    Evertjan. Guest

    Adrienne Boswell wrote on 05 mrt 2010 in
    microsoft.public.inetserver.asp.general:
    Or the ALT-LeftArrow.
     
    Evertjan., Mar 5, 2010
    #4
  5. chumley

    chumley Guest

    No, has to be customizeable button that carries querystrings upon
    conditions. I have a lot of these figured out now, thanks for looking/
    replying :), may hav more questions regarding this
    chumley
     
    chumley, Mar 6, 2010
    #5
  6. chumley

    Bob Barrows Guest

    Well, you'll get more people looking at them if you post them to relevant
    newsgroups. Client-side questions should be asked at .scripting.jscript or
    comp.lang.javascript.
     
    Bob Barrows, Mar 6, 2010
    #6
  7. Gazing into my crystal ball I observed chumley <>
    writing in

    Please don't quote signatures.
    And what are you going to do if the user has client side scripting
    disabled or unavailable? Just make sure that you're covered server side.
     
    Adrienne Boswell, Mar 6, 2010
    #7
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.