Click to See Complete Forum and Search --> : Why won't this work??


freakonaleash
08-05-2003, 03:59 PM
Can anybody help me, i want to make a drop down navigation menu, what am i doing wrong?

<BODY>

<P ALIGN="right"> Quick-Nav:

<SELECT NAME="QuickNav" SIZE="1">
<OPTGROUP LABEL="Client">
<OPTION VALUE= <A HREF="sitemap.html" TARGET="MAIN">The Main Page</OPTION>
<OPTION VALUE= <A HREF="disclaimer.html" TARGET="MAIN">The Disclaimer</OPTION>
<OPTION VALUE= <A HREF="client.html" TARGET="MAIN">Technician Search</OPTION>
</OPTGROUP>

<OPTGROUP LABEL="Technician">
<OPTION VALUE= <A HREF="register.html" TARGET="MAIN">Register</OPTION>
<OPTION VALUE= <A HREF="personnel.html" TARGET="MAIN">Log-In</OPTION>
</OPTGROUP>
</SELECT>

</BODY>
</HTML>

havik
08-05-2003, 04:07 PM
Why not try a form select box instead?

<HTML>
<HEAD>
<TITLE>Drop Down Navigation menu</TITLE>

<SCRIPT LANGUAGE="JavaScript">

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

</SCRIPT>

</HEAD>

<BODY>

<P ALIGN="right"> Quick-Nav:

<form name="form">
<select name="site" size=1>
<option value="">Go to....
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.cnn.com">CNN
<option value="forums.webdeveloper.com">Web Dev Forums
</select>
<input type=button value="Go!" onClick="javascript:dropDownMenu(this)">
</form>

</BODY>
</HTML>



Havik

freakonaleash
08-05-2003, 04:10 PM
thankyou for your help havik, that's great! Cheers

havik
08-05-2003, 04:14 PM
Here's a better version already designed to meet your needs:

<HTML>
<HEAD>
<TITLE>Drop Down Navigation menu</TITLE>

<SCRIPT LANGUAGE="JavaScript">

function dropDownMenu(form)
{
var URL = document.form.site.options[document.form.site.selectedIndex].value;

if(URL != "client" && URL != "technician")
{
window.location.href = URL;
}
}

</SCRIPT>

</HEAD>

<BODY>

<P ALIGN="right"> Quick-Nav:

<form name="form">
<select name="site" size=1 onChange="javascript:dropDownMenu(this)">
<option value="client">Client
<option value="sitemap.html">The Main Page
<option value="disclaimer.html">The Disclaimer
<option value="client.html">Technician Search
<option value="technician">Technician
<option value="register.html">Register
<option value="personnel.html">Log-In
</select>
</form>

</BODY>
</HTML>


Havik

Quasibobo
08-05-2003, 05:31 PM
How about this one:

<form>
<select onChange="top.location = this.options[this.selectedIndex].value;">
<OPTION VALUE= "sitemap.html">The Main Page</OPTION>
<OPTION VALUE= "disclaimer.html">The Disclaimer</OPTION>
<OPTION VALUE="client.html">Technician Search</OPTION>
</select>
</form>