Solved

Problems with anchors

Posted on 2000-02-25
6
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

617 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