Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: How to use <A NAME> with drop box

  • Subject: Re: How to use <A NAME> with drop box
  • From: Roy Schestowitz <newsgroups@schestowitz.com>
  • Date: Sat, 30 Jul 2005 04:03:11 +0100
  • Newsgroups: comp.infosystems.www.authoring.html
  • Organization: schestowitz.com / Manchester University
  • References: <zdAGe.28503$mC.7526@okepread07>
  • Reply-to: newsgroups@schestowitz.com
  • User-agent: KNode/0.7.2
Yeah wrote:

> I wish to use a drop box where each Option will not take the user to a web
> page - but a certain location on the same page the drop box exists. For
> example, Option 1 would take the user to "Chapter 1", Option 2 would be
> "Chapter 2", and so on. All destinations are on the same page.
> 
> I already have <A NAME="#ChapterX"> tags placed in the appropriate places
> in the document. (A no-GO button drop box is preferred.)
> 
> How do I achieve this?

Try this...

In <head>:

<script type="text/javascript">


function formHandler(form){
var URL =
document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

</script>



In <body>:

<form name="form">
<select name="site" onChange="javascript:formHandler()">
<option value="index.html#chaper1">Chapter 1
<option value="index.html#chaper2">Chapter 2
</select>
</form>

Also:

<A NAME="#chapter1">Chapter 1</A>

...

<A NAME="#Chapter2">Chapter 2</A>

...




I can confirm that it works properly in all major modern browsers.

Roy

-- 
Roy S. Schestowitz
http://Schestowitz.com

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index