473,621 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 17 '05 #1
7 4277
In article <52************ **************@ posting.google. com>, Niall Linden wrote:
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


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>
Jul 17 '05 #2
"Niall Linden" <ni*********@ya hoo.com> wrote in message
news:52******** *************** ***@posting.goo gle.com...
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


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

- Virgil
Jul 17 '05 #3
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" <vj*@DESPAMobsy dian.com> wrote in message news:<Qk******* **********@news svr24.news.prod igy.com>...
"Niall Linden" <ni*********@ya hoo.com> wrote in message
news:52******** *************** ***@posting.goo gle.com...
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


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

- Virgil

Jul 17 '05 #4
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" <vj*@DESPAMobsy dian.com> wrote in message news:<Qk******* **********@news svr24.news.prod igy.com>...
"Niall Linden" <ni*********@ya hoo.com> wrote in message
news:52******** *************** ***@posting.goo gle.com...
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


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

- Virgil

Jul 17 '05 #5

"Niall Linden" <ni*********@ya hoo.com> wrote in message
news:52******** *************** ***@posting.goo gle.com...
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


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
Jul 17 '05 #6
Hi,

On 31 Aug 2004 09:03:27 -0700, ni*********@yah oo.com (Niall Linden)
wrote:
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


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/
Jul 17 '05 #7
Jochen Daum wrote:

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


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

http://skrb.org/ietf/http_errata.htm...tion-fragments

--
Jock
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2484
by: Jamie Jackson | last post by:
I'm using showModalDialog() to popup a window with some long text, followed by a couple of form elements. The content of the popup scrolls, since the content is longer to than the window. However, when it first opens, it is positioned at the bottom of the modal window's content, so one has to scroll to see the beginning of the content. It happens to be positioning the window so the bottom of the submit button is at the bottom of the popup....
2
2339
by: Niall Linden | last post by:
is there any way to jump to an anchor on the page load. the thing is I dont want to reload the page (as the page is being called by a submit button on a form, so if i call the page again with an anchor tag i loose all the form details) someone said that to jump to an anchor with name anchorID you could use document.getElementbyID("anchorID").click();
17
1650
by: compassSoftware | last post by:
Hi, I have two horizontal frames, one on top of the other. The top frame is an image map of a street with property boundary's on it. The bottom frame is a table with each row of the table holds details about a perticular property from the image map above.
3
1439
by: compassSoftware | last post by:
Hi, I have a script that allows me to highlight a row of text. This text is in a table. The table is long and scrolls down the page below the visiable canvas. What I need is a method to jump to the highlighted row.
1
6254
by: Robert Mark Bram | last post by:
Hi All, We are using a scrolling iFrame to present a list of options to the user within the main page with an anchor against each option. Depending on the user actions, we jump to an anchor in the frame with code like this: theFrameSrc = theFrame.src; theFrame.src = theFrameSrc + "#" + anchorName;
2
13849
by: TheITGuyFromNY | last post by:
To set this up, I have a parent window with a list of things (doesn't matter what they are, but they are loaded by the page dynamically from a database with ASP server-side script. So, next to each item is an EDIT link that opens up a child window, sending it a REQUEST object with a value that helps the window look up some things about the list item in the database that the web user can then edit in a form and, of course, submit. Finally, and...
20
1978
by: Prisoner at War | last post by:
Hi, People, Is it possible to have an "empty" or "dummy" <a href***without*** the browser jumping back up the page?? I have a hyperlink that doesn't point to another document, but is used to call forth a modal window onClick (or is there another way, without text or image links, of calling forth JavaScript on user activity??). I would like to spare my visitors the inconvenience and visually jarring effect of getting thrown back up to...
6
2155
by: shapper | last post by:
Hello, On a bottom of a form I have 2 buttons: Submit and Cancel. Submit is an input and submits the form. Cancel should just redirect the user to a new page without submitting the form. I need the Cancel button to look the same as the Submit button. If I use an input of type button as Cancel button I am able to do that
0
8213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8156
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8306
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8457
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4065
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.