Solved

Problems with anchors

Posted on 2000-02-25
6
290 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

708 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

11 Experts available now in Live!

Get 1:1 Help Now