Solved

Problems with anchors

Posted on 2000-02-25
6
294 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

823 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