Solved

Problems with anchors

Posted on 2000-02-25
6
293 Views
Last Modified: 2010-04-09
I have a dropdown box with a go button on one page. Each of the values points to a page with an anchor. But for some reason, it won't go to the anchor, it just goes to the bottom of the page. I've tested the anchors to make sure they work without the dropdown box and everything checks out. Any suggestions?
0
Comment
Question by:kch011099
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:jbeaman
ID: 2558198
Can you post your code or give us a URL so we can check it out?

Thanks
0
 

Author Comment

by:kch011099
ID: 2558234
Script and dropdown box with go
--------------------------------------
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function formHandler(dropdown){
var URL = document.dropdown.mins.options[document.dropdown.mins.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
                                    <form name="dropdown">
                                    <select name="mins" align="left" size="1">
                                          <option value="">Please Select Destination
                                          <option value="">-----------------
                                          <option value="page.html#1">Anchor 1
                                          <option value="page.html#2">Anchor 2
                                          <option value="page.html#3">Anchor 3
                                    </select><input type="button" value="Go" onClick="javascript:formHandler()"></form>
--------------------------------------

page.html
--------------------------------------
<a name="1"></a>First Anchor<br>
asdjflkasdjf
asdlkfjasdlkf
adflkjasdlkf
<br>
<a name="2"></a>Second Anchor<br>
asdjflkasdjf
asdlkfjasdlkf
adflkjasdlkf
<br>
<a name="3"></a>Third Anchor<br>
asdjflkasdjf
asdlkfjasdlkf
adflkjasdlkf
<br>
--------------------------------------
0
 
LVL 9

Accepted Solution

by:
TTom earned 25 total points
ID: 2558372
Your code actually works properly (in IE5).  I think the problem is that "page.html" does not have enough lines of text for the anchors to display the way you are expecting.

I added a number of "<P>1" entries between the anchors and tried it out.  Worked perfectly.

Tom
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:kch011099
ID: 2558404
The page.html code I posted is not the actual code. It is actually very long and intense and I had to split it into 3 pages. That is why I'm using anchors. You are right, it does work in IE, but I need it to work in Netscape as well. I added a regular link to the page with the dropdown box that links to one of the anchors and it is still not working in Netscape. However, when I add that same link to the page.html code with the anchors on that same page, the anchors work. I can't figure out the problem.
0
 

Author Comment

by:kch011099
ID: 2558491
I found out the problem.

Netscape is really picky about using tables and anchors. If you have an ALIGN command in the TABLE tag, it will ignore the anchors and take you to the bottom of the page. Someone, prior to me, had this exact same problem and found the answer. (How did anyone figure that out, it seems so unrelated!)

Well, now everything works great.
I will give TTom the points since you tried to help me.

Thanks.
0
 
LVL 9

Expert Comment

by:TTom
ID: 2558754
Thanks!  Sorry I didn't have the NS solution for you.  Good info!

Tom
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now