468,315 Members | 1,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,315 developers. It's quick & easy.

Roll to web page vertical position

Hi,

I have a php web page which lets users to select choices from combo
box and submit the page to update the item description. However, when
I have many items on the same page, the row position reset to the
beginning of the page. So this makes trouble to the users that he has
to find again the product item row position to see the item
desctiption.

Could anyone tell me how to automatically roll the web page to the
vertical positon which is same as previous page?

Thanks!
Jul 17 '05 #1
6 2170
"terry" <le*******@yahoo.com> wrote in message
news:99*************************@posting.google.co m...
Hi,

I have a php web page which lets users to select choices from combo
box and submit the page to update the item description. However, when
I have many items on the same page, the row position reset to the
beginning of the page. So this makes trouble to the users that he has
to find again the product item row position to see the item
desctiption.

Could anyone tell me how to automatically roll the web page to the
vertical positon which is same as previous page?

Thanks!


Use anchors (i.e. "<a name='item14'></a>"). This has nothing to do with PHP,
since PHP is server-side.
Jul 17 '05 #2
kingofkolt wrote:
"terry" <le*******@yahoo.com> wrote in message
news:99*************************@posting.google.co m...
Hi,

I have a php web page which lets users to select choices from combo
box and submit the page to update the item description. However, when
I have many items on the same page, the row position reset to the
beginning of the page. So this makes trouble to the users that he has
to find again the product item row position to see the item
desctiption.

Could anyone tell me how to automatically roll the web page to the
vertical positon which is same as previous page?

Thanks!

Use anchors (i.e. "<a name='item14'></a>"). This has nothing to do with PHP,
since PHP is server-side.


Dont use A tags. Use IDs. Its better and you can use them not only on A
tags. For instance, use DIVs (much better for design if you use CSS):

<div id="entry12">
<a href="index.php?mode=edit_entry&entry=12">Edit entry</a>
</div>

And you go as www.mysite.com/index.php?mode=view#entry12
Jul 17 '05 #3
> <div id="entry12">
<a href="index.php?mode=edit_entry&entry=12">Edit entry</a>
</div>

And you go as www.mysite.com/index.php?mode=view#entry12


Your method is OK.

But if the link is clicked by a form button,

for example, I have tried the following

:
:
print("<form action=\"".$_SERVER["PHP_SELF"]."#'".str_replace("
","_",$name)."'\" method=get>");
:
:

but cannot succeed.

Could u teach me more?
Jul 17 '05 #4

"terry" <le*******@yahoo.com> wrote in message
news:99*************************@posting.google.co m...
<div id="entry12">
<a href="index.php?mode=edit_entry&entry=12">Edit entry</a>
</div>

And you go as www.mysite.com/index.php?mode=view#entry12


Your method is OK.

But if the link is clicked by a form button,

for example, I have tried the following

:
:
print("<form action=\"".$_SERVER["PHP_SELF"]."#'".str_replace("
","_",$name)."'\" method=get>");
:
:

but cannot succeed.

Could u teach me more?


You cannot use anchors when posting from the client to the server. They are
only effective on the client when included in URLs. It is possible to
generate a URL from the server (i.e. from within PHP) which will set the
cursor at a particular point when the HTML document is rendered. I know
because I have done it.

--
Tony Marston

http://www.tonymarston.net

Jul 17 '05 #5
terry wrote:
Could anyone tell me how to automatically roll the web page to the
vertical positon which is same as previous page?


Impossible: there's no way to tell what position the
previous page was in.

By naming elements you can tell which form was submitted,
and which submit button if any was used -- if in fact your
form was used. You can then issue a redirection that
includes a fragment identifier which points to a particular
place.

--
Jock
Jul 17 '05 #6
Ilija Studen wrote:
kingofkolt wrote:
Use anchors (i.e. "<a name='item14'></a>").

Dont use A tags. Use IDs. Its better
In theory, Yes; in practice, maybe not yet. At least not if
you want to support '[s]ome older user agents [which] don't
support anchors created with the id attribute' (HTML4.01
sec. 12.2.3). That's probably not too significant now, but
still worth bearing in mind.
and you can use them not only on A tags.


A good point, and one of the reasons why id is more logical
than name for destination anchors.

[ ... ]

--
Jock
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by tradmusic.com | last post: by
reply views Thread by Brian Sabolik | last post: by
5 posts views Thread by Markus Ernst | last post: by
40 posts views Thread by maya | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.