jumping to anchor after submit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Niall Linden

    #1

    jumping to anchor after submit

    i have a form with lots of data, and when they click on a button it
    calls some javascript which sets values in hidden fields then posts to
    itself (usual stuff)

    now the problem is that i would like to bring the page back to the
    same spot after the submit (as its very long)

    Ive added anchors to each button but if i add a the anchor tag to the
    action part of the form, im always one click behind, ie it jumps to
    the one I clicked on before. ive tried using location header etc
    calling itself and appending #anchorname to the end of the url, but
    then i lose the data in the form, as no $_requests have data any more.

    so what i need is when you hit a button, sumit the page && go to the
    correct anchor. is this possible

    Niall
  • Tim Van Wassenhove

    #2
    Re: jumping to anchor after submit

    In article <52684575.04082 60403.6ee72e1e@ posting.google. com>, Niall Linden wrote:[color=blue]
    > Ive added anchors to each button but if i add a the anchor tag to the
    > action part of the form, im always one click behind, ie it jumps to
    > the one I clicked on before. ive tried using location header etc
    > calling itself and appending #anchorname to the end of the url, but
    > then i lose the data in the form, as no $_requests have data any more.
    >
    > so what i need is when you hit a button, sumit the page && go to the
    > correct anchor. is this possible[/color]

    Meaby with JavaScript... But with PHP you don't have any influence on
    what happen at the client-side.

    --
    Tim Van Wassenhove <http://home.mysth.be/~timvw>

    Comment

    • Virgil Green

      #3
      Re: jumping to anchor after submit

      "Niall Linden" <nialllinden@ya hoo.com> wrote in message
      news:52684575.0 408260403.6ee72 e1e@posting.goo gle.com...[color=blue]
      > i have a form with lots of data, and when they click on a button it
      > calls some javascript which sets values in hidden fields then posts to
      > itself (usual stuff)
      >
      > now the problem is that i would like to bring the page back to the
      > same spot after the submit (as its very long)
      >
      > Ive added anchors to each button but if i add a the anchor tag to the
      > action part of the form, im always one click behind, ie it jumps to
      > the one I clicked on before. ive tried using location header etc
      > calling itself and appending #anchorname to the end of the url, but
      > then i lose the data in the form, as no $_requests have data any more.
      >
      > so what i need is when you hit a button, sumit the page && go to the
      > correct anchor. is this possible[/color]

      Hard to tell. Show a small, complete example set of code that demonstrates
      the problem.

      - Virgil


      Comment

      • Niall Linden

        #4
        Re: jumping to anchor after submit

        basically i have lots of rows with anchors

        <tr><td id =0 class='listTime ' height='12'><a
        name='a0'>&nbsp ;</a>0:00</td></tr>

        <tr><td id =1 class='listTime ' height='10'><a
        name='a1'>&nbsp ;</a>0:30</td></tr><tr>

        and there are lots of them, in a scrollable div.

        now i have a form on this table, which posts to itself. but the
        question is, depending on the information sent in the form, i would
        like to jump to one of the rows (presumably using their anchors). ie
        you slect 5 and it goes to the 5th row. but i cant figure out how to
        do this.

        so when i an reloading the page (after the submit) i have the anchor
        id that i want to go to, but i dont know how to get there directly. i
        cant repost with a #id at the end of the url because this will just
        cause me to loose all the request info being submitted


        any help appreciated

        Niall



        "Virgil Green" <vjg@DESPAMobsy dian.com> wrote in message news:<QklXc.637 2$z44.1248@news svr24.news.prod igy.com>...[color=blue]
        > "Niall Linden" <nialllinden@ya hoo.com> wrote in message
        > news:52684575.0 408260403.6ee72 e1e@posting.goo gle.com...[color=green]
        > > i have a form with lots of data, and when they click on a button it
        > > calls some javascript which sets values in hidden fields then posts to
        > > itself (usual stuff)
        > >
        > > now the problem is that i would like to bring the page back to the
        > > same spot after the submit (as its very long)
        > >
        > > Ive added anchors to each button but if i add a the anchor tag to the
        > > action part of the form, im always one click behind, ie it jumps to
        > > the one I clicked on before. ive tried using location header etc
        > > calling itself and appending #anchorname to the end of the url, but
        > > then i lose the data in the form, as no $_requests have data any more.
        > >
        > > so what i need is when you hit a button, sumit the page && go to the
        > > correct anchor. is this possible[/color]
        >
        > Hard to tell. Show a small, complete example set of code that demonstrates
        > the problem.
        >
        > - Virgil[/color]

        Comment

        • Niall Linden

          #5
          Re: jumping to anchor after submit

          basically i have lots of rows with anchors

          <tr><td id =0 class='listTime ' height='12'><a
          name='a0'>&nbsp ;</a>0:00</td></tr>

          <tr><td id =1 class='listTime ' height='10'><a
          name='a1'>&nbsp ;</a>0:30</td></tr><tr>

          and there are lots of them, in a scrollable div.

          now i have a form on this table, which posts to itself. but the
          question is, depending on the information sent in the form, i would
          like to jump to one of the rows (presumably using their anchors). ie
          you slect 5 and it goes to the 5th row. but i cant figure out how to
          do this.

          so when i an reloading the page (after the submit) i have the anchor
          id that i want to go to, but i dont know how to get there directly. i
          cant repost with a #id at the end of the url because this will just
          cause me to loose all the request info being submitted


          any help appreciated

          Niall



          "Virgil Green" <vjg@DESPAMobsy dian.com> wrote in message news:<QklXc.637 2$z44.1248@news svr24.news.prod igy.com>...[color=blue]
          > "Niall Linden" <nialllinden@ya hoo.com> wrote in message
          > news:52684575.0 408260403.6ee72 e1e@posting.goo gle.com...[color=green]
          > > i have a form with lots of data, and when they click on a button it
          > > calls some javascript which sets values in hidden fields then posts to
          > > itself (usual stuff)
          > >
          > > now the problem is that i would like to bring the page back to the
          > > same spot after the submit (as its very long)
          > >
          > > Ive added anchors to each button but if i add a the anchor tag to the
          > > action part of the form, im always one click behind, ie it jumps to
          > > the one I clicked on before. ive tried using location header etc
          > > calling itself and appending #anchorname to the end of the url, but
          > > then i lose the data in the form, as no $_requests have data any more.
          > >
          > > so what i need is when you hit a button, sumit the page && go to the
          > > correct anchor. is this possible[/color]
          >
          > Hard to tell. Show a small, complete example set of code that demonstrates
          > the problem.
          >
          > - Virgil[/color]

          Comment

          • Virgil Green

            #6
            Re: jumping to anchor after submit


            "Niall Linden" <nialllinden@ya hoo.com> wrote in message
            news:52684575.0 408310756.7d02e fe1@posting.goo gle.com...[color=blue]
            > basically i have lots of rows with anchors
            >
            > <tr><td id =0 class='listTime ' height='12'><a
            > name='a0'>&nbsp ;</a>0:00</td></tr>
            >
            > <tr><td id =1 class='listTime ' height='10'><a
            > name='a1'>&nbsp ;</a>0:30</td></tr><tr>
            >
            > and there are lots of them, in a scrollable div.
            >
            > now i have a form on this table, which posts to itself. but the
            > question is, depending on the information sent in the form, i would
            > like to jump to one of the rows (presumably using their anchors). ie
            > you slect 5 and it goes to the 5th row. but i cant figure out how to
            > do this.
            >
            > so when i an reloading the page (after the submit) i have the anchor
            > id that i want to go to, but i dont know how to get there directly. i
            > cant repost with a #id at the end of the url because this will just
            > cause me to loose all the request info being submitted[/color]

            Apparently, you missed the word "complete". We need to see a complete
            example the demonstrates the behavior. If you don't know what the problem
            is, it is unlikely that you'll post the correct, relevant snippets of code.
            Post a complete example that can be executed by someone who desires to help.

            - Virgil


            Comment

            • Jochen Daum

              #7
              Re: jumping to anchor after submit

              Hi,

              On 31 Aug 2004 09:03:27 -0700, nialllinden@yah oo.com (Niall Linden)
              wrote:
              [color=blue]
              >basically i have lots of rows with anchors
              >
              > <tr><td id =0 class='listTime ' height='12'><a
              >name='a0'>&nbs p;</a>0:00</td></tr>
              >
              ><tr><td id =1 class='listTime ' height='10'><a
              >name='a1'>&nbs p;</a>0:30</td></tr><tr>
              >
              >and there are lots of them, in a scrollable div.
              >
              >now i have a form on this table, which posts to itself. but the
              >question is, depending on the information sent in the form, i would
              >like to jump to one of the rows (presumably using their anchors). ie
              >you slect 5 and it goes to the 5th row. but i cant figure out how to
              >do this.
              >
              >so when i an reloading the page (after the submit) i have the anchor
              >id that i want to go to, but i dont know how to get there directly. i
              >cant repost with a #id at the end of the url because this will just
              >cause me to loose all the request info being submitted[/color]

              Do you loose all the request info, because you use a GET request. You
              might as well do POST.

              redrecting does also not work AFAIK, because it doesn't support
              anchors

              HTH, Jochenl

              --
              Jochen Daum - Cabletalk Group Ltd.
              PHP DB Edit Toolkit -- PHP scripts for building
              database editing interfaces.
              http://sourceforge.net/projects/phpdbedittk/

              Comment

              • John Dunlop

                #8
                Re: jumping to anchor after submit

                Jochen Daum wrote:

                [ ... ]
                [color=blue]
                > redrecting does also not work AFAIK, because it doesn't support
                > anchors[/color]

                You'd think so after reading RFC2616, wouldn't you? It's in
                the errata though, thankfully.

                Grey Glacier is a family office focused on acquiring private manufacturing, distribution, and industrial services businesses between $1M - $10M EBITDA.


                --
                Jock

                Comment

                Working...