html anchors help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yaron
Forum Contributor
Posts: 157
Joined: Fri Aug 22, 2003 8:40 am

html anchors help

Post by yaron »

Hello all,

'm using php but my question is more of an html/javaScript question that I hope you can help me with.

I have a php script which I output a lot of data devided into subjects.
each subject has a title which is a html anchor.
There can be up to 1000 subjects/anchors in my html output page.
I want to help the user browse through my massive output by those anchors.
I want to give him the ability to choose the anchor name (in my case an icremented number) and then click on a button that will bring him to the write place in my output page.

can it be done?
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Re: html anchors help

Post by TheBentinel.com »

You can create a <SELECT> with <OPTION>'s for each anchor. Then your "GO" button would change the document.location.href to whatever anchor they selected. You can see an example of it on cnn.com, look at the bottom of the page where you can select "languages".

View source and you'll see the code running it. They do it onChange of the select, so there's no Go button.
Post Reply