Jump to named anchor after form processing

Discussion in 'ASP General' started by Robert Mark Bram, Oct 20, 2004.

  1. Hi All!

    Let's say I have a form like this:

    <form action="handler.asp"> ... </form>

    Within handler.asp, I output a number of named anchors:

    <a name="important1">Important 1</a> ...
    <a name="important2">Important 2</a> ...
    <a name="important3">Important 3</a> ...

    In my form processing code, I want the returned page to jump to one of
    these anchors depending on the result of the processing.

    How can I do this?

    I don't want to use a redirection because then I would have to
    re-process the same page..

    Any advice would be most appreciated!

    Rob
    :)
    Robert Mark Bram, Oct 20, 2004
    #1
    1. Advertising

  2. Robert Mark Bram

    Evertjan. Guest

    Robert Mark Bram wrote on 20 okt 2004 in
    microsoft.public.inetserver.asp.general:

    > Hi All!
    >
    > Let's say I have a form like this:
    >
    > <form action="handler.asp"> ... </form>
    >
    > Within handler.asp, I output a number of named anchors:
    >
    > <a name="important1">Important 1</a> ...
    > <a name="important2">Important 2</a> ...
    > <a name="important3">Important 3</a> ...
    >
    > In my form processing code, I want the returned page to jump to one of
    > these anchors depending on the result of the processing.
    >
    > How can I do this?
    >
    > I don't want to use a redirection because then I would have to
    > re-process the same page..
    >
    > Any advice would be most appreciated!


    I would not use a <form> here.

    Try:

    <a href="#important1">Important 1</a><br>
    <a href="#important2">Important 2</a>

    and keep the anchors on the same page:

    <a name="important1"></a>What is important 1 ...
    <a name="important2"></a>What is important 2[too?] ...

    The browser cache will not send a request to the server if your asp code
    allows a long enough expiry time[-out], say:

    <% Response.Expires = 40 %>

    [and do not use <base href=> or no-cache meta directives here!]

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Oct 20, 2004
    #2
    1. Advertising

  3. Hi Evertjan!

    Thank you for your response.

    > I would not use a <form> here.


    Hmm... but there is some user input that I need to obtain in order to do
    my processing.

    > Try:
    >
    > <a href="#important1">Important 1</a><br>
    > <a href="#important2">Important 2</a>
    >
    > and keep the anchors on the same page:
    >
    > <a name="important1"></a>What is important 1 ...
    > <a name="important2"></a>What is important 2[too?] ...
    >
    > The browser cache will not send a request to the server if your asp code
    > allows a long enough expiry time[-out], say:
    >
    > <% Response.Expires = 40 %>


    I don't quite understand what is happenning here. The page blocks for a
    while, waiting for some response?

    Rob
    :)
    Robert Mark Bram, Oct 20, 2004
    #3
  4. Robert Mark Bram

    Evertjan. Guest

    Robert Mark Bram wrote on 20 okt 2004 in
    microsoft.public.inetserver.asp.general:

    > Hi Evertjan!
    >
    > Thank you for your response.
    >
    >> I would not use a <form> here.

    >
    > Hmm... but there is some user input that I need to obtain in order to
    > do my processing.


    then use seperate forms:

    <form action="#important1" method=post>
    <input your user input for posting
    </form>
    <form action="#important2" method=post>
    <input your user input for posting
    </form>

    or use clientsied scripting to cange the action string.

    OT on this ASP NG!!!

    >
    >> Try:
    >>
    >> <a href="#important1">Important 1</a><br>
    >> <a href="#important2">Important 2</a>
    >>
    >> and keep the anchors on the same page:
    >>
    >> <a name="important1"></a>What is important 1 ...
    >> <a name="important2"></a>What is important 2[too?] ...
    >>
    >> The browser cache will not send a request to the server if your asp
    >> code allows a long enough expiry time[-out], say:
    >>
    >> <% Response.Expires = 40 %>

    >
    > I don't quite understand what is happenning here. The page blocks for
    > a while, waiting for some response?


    Its unclear what you mean with "blocks".

    Anyway, as it is not an ASP problem, [except for the timeout],
    this is OT.

    I suggest you ask in a cliendside code NG.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Oct 21, 2004
    #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. Robert Wehofer

    How to jump to an anchor?

    Robert Wehofer, Nov 13, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    3,217
    John Carnahan
    Nov 17, 2003
  2. darrel
    Replies:
    16
    Views:
    13,382
    darrel
    Feb 8, 2005
  3. Aaron Freeman
    Replies:
    7
    Views:
    1,735
    Jonathan N. Little
    Mar 17, 2006
  4. TWW
    Replies:
    1
    Views:
    130
    A. Sinan Unur
    Jul 16, 2003
  5. Eadwine Rose
    Replies:
    2
    Views:
    202
    Eadwine Rose
    Oct 15, 2006
Loading...

Share This Page