Solved

Problems with anchors

Posted on 2000-02-25
6
297 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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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)

752 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