[WEB4LIB] Re: javascript
Andrew I. Mutch
amutch at waterford.lib.mi.us
Tue Nov 9 20:05:08 EST 1999
Vicki,
There are a number of variations of Javascript that will do this. Most
are fairly straight-forward and can just be cut-n-pasted into a page. You
can also do this with a CGI script or a Java applet but I don't know of a
plain HTML method to accomplish this. This is the script I use:
Paste the following between your <HEAD></HEAD> tags.
<script type="text/javascript">
<!--
function jmp(formnum,menunum)
{with (document.forms[formnum].elements[menunum])
{i=selectedIndex;location=options[i].value;}}
// -->
</SCRIPT>
Use the following code for your form - this particular variation allows
you to place multiple "Jump" menus on one page:
<form name="menu" method=POST OnSubmit="return false">
<select name="m" size=1 onChange="jmp(0,0)">
<option selected value="">Select a Site!
<option value="http://URL1.com">Site 1</option>
<option value="http://URL2.org">Site 2</option>
</select>
<input type=submit value="Go!" onClick="jmp(0,0)">
</form>
I got my first taste of Javascript adding these menus. Another
alternative is to use to "Menu Maker" tool at Builder.com - its code is
more involved but it writes it all for you - you just enter your URLs.
http://www.builder.com/Programming/Scripter/
Good Luck!
Andrew Mutch
Library Systems Technician
Waterford Township Public Library
Waterford, MI
On Tue, 9 Nov 1999, Vicki Falkland wrote:
> Is there a "simple" code to then make each option to to a URL, or must Java
> be employed? I've seen the Java code for this (and tried it), but its huge
> .. and not being a "coder" in any way, shape or form, the prospect of
> editing it is a little daunting. I'd rather use simple HTML.
>
> thanks,
>
> Vicki
>
> >This would give you a drop down box that has information in it, but it
> >doesn't do anything (doesn't send the viewer to a different page, doesn't
> >call up any other function).
> >
> >(tested on NN 4.08)
> >
> ><FORM>
> > Poem<P>
> > <SELECT NAME="poem" >
> > <OPTION>Strict syllable count,
> > <OPTION>the rigid, harsh form becomes
> > <OPTION>a lovely haiku.
> > </SELECT>
> > </FORM>
> >
> >HTH,
> >TTFN,
> >David Merchant
> >
>
>
>
> ____________________________________________
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> J.W. Grieve Library
> Royal Children's Hospital
> Flemington Rd
> Parkville, VIC, 3052
> Australia
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> ph: 61 3 9345 5108
> fax: 61 3 9347 8421
> email: library at cryptic.rch.unimelb.edu.au
> URL: http://www.rch.unimelb.edu.au/library
> ____________________________________________
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
More information about the Web4lib
mailing list