Gossamer Forum
Home : Products : DBMan SQL : Discussion :

URL Anchor

Quote Reply
URL Anchor
Hi,
I'm having problems with my url anchors not snaping to the top of the page.
When I link to my search results using -
http://www.mydomain.com/cgi-local/dbman/db.cgi?db=objectives&do=search_results&build_objectives=1&year=2004&month_id=07&user=username&sb=objective_id&so=ASC#73
the search results are returned but the "#73" point is not at the top of my browser window but usually around the center of the window. There are about 10 tables of results displayed on the page and the link is returning in the general area but I can't work out why it doesn't snap to the top. If it was only the last table at the bottom of the page then I would understand that it can't snap to the top but it applies to all tables.
Once the results page has loaded, if I manually change the anchor in the url it works (this doesn't refresh the window, it only changes the position of what is displayed).
Also, if I save the html page and open the file in my browser then manually change the anchor name (e.g "#73" or "#75" etc.) they all snap to the top (again this is not refreshing the page and is only changing the position of what is displayed).
All this leads me to assume the html is ok and the problem is somewhere in the script and something to do with the page being initially loaded and/or refreshed.
Does anyone have any ideas what may be causing this problem?
Thank you.
Simon.
Quote Reply
Re: [jai] URL Anchor In reply to
Hi Simon

in your customized search results template, you can define anchors in different ways:
-> possibility 1: <A name="<%ID%>"><%ID%></A>
-> possibility 2: naming an element with the id tag, e.g. <ELEMENT id="<%ID%>">
(supposing you want to use your record ID for the anchor)

Have you tested both possibilities in all browsers (same error everywhere)?

I think the problem has nothing to do with the DBManSQL script itself - I've tried out this anchor thingy and it does snap to the top on my system (unless it's not located in the bottom area of the page as you mentioned). Please post more details of your search results template so that we can have a look at it...

Cheers,
Oliver