PDA

View Full Version : Drop-down menus for navigation


aurus_steelswor
03-30-2003, 04:15 AM
I'm having some trouble with a drop-down menu that I'm trying to use for navigation on my site. The menu is in one frame ("left"), and I want it to change a different frame ("main"), but I can't figure out how to specify that. Anyone have any advice?

Thanks a bunch!

Aurus

cg9com
03-30-2003, 06:25 AM
hi,
are you speaking of the <select> form element?
try this:

<select onChange="top.frames['FrameName'].location=options[selectedIndex].value;">

Change the blue to your frames name then add the rest. :thumbsup:

Mhtml
03-30-2003, 01:07 PM
Just incase you have something like "Please select..." or "quick links..." you may want an if statement.
<select onChange="if(this.value !== 'noRedir'){top.frames['FrameName'].location=options[selectedIndex].value;}">


Just have <option value="noRedir">Please choose....</option>

I hate when I forget to do that and then if you change back to the original value it tries to redirect to 'http://www.yourdomain.com/please choose...' ...

aurus_steelswor
03-30-2003, 06:19 PM
Yep, <select> is what I'm using... thanks a bunch! :D

aurus_steelswor
03-30-2003, 06:47 PM
Hm, I'm still having a bit of trouble with it... now the new pages open in the whole frame.

What I've got so far is: <select onChange="if(this.value !== 'noRedir'){top.frames['main'].location=options[selectedIndex].value;}">

Is that right? (in case you can't tell, I'm something of an HTML dunce, so I'm probably way in over my head... ;) )

cg9com
03-30-2003, 09:09 PM
show us the full code you are using.
heres what mine should look like.
and by the way onchange="" is all javascript.

<form>
<fieldset>
<select onChange="top.frames['FrameName'].location=options[selectedIndex].value;">
<option value="website">output text</option>
</select>
</fieldset>
</form>

aurus_steelswor
03-30-2003, 09:35 PM
Okay, this is what I've got:

<form name="a294" >
<select onChange="if(this.value !== 'noRedir'){top.frames['main'].location=options[selectedIndex].value;}"
style="font-family: Abadi MT Condensed Light; color: #000000; font-size: 8pt;">
<option value="noRedir">Navigation!</option>
<option value="framemain.htm">Main</option>
<option value="updates.htm">Updates</option>
<option value="aboutme.htm">About Me</option>
<option value="/artwork/index.htm">Artwork</option>
<option value="archiv.htm">Layout Archive</option>
<option value="links.htm">Links</option>
<option value="resources.htm">Resources</option>
<option value="copyright.htm">Copyright</option>
<option value="http://pub40.bravenet.com/guestbook/show.php?usernum=3364416109&cpv=1">Guestbook</option>
<option value="contact.htm">Contact</option>
</select></form>

aurus_steelswor
04-03-2003, 06:37 PM
I hate to sound impatient, but... have you found anything wrong with that yet? I'm kind of sitting in the dark here, so to speak... *blinks*

Roy Sinclair
04-03-2003, 07:10 PM
This may not help but I do see something I don't think is valid and it may be having an effect on your page, the check should be != instead of !==.


<select onChange="if(this.value != 'noRedir'){top.frames['main'].location=options[selectedIndex].value;}"

aurus_steelswor
04-03-2003, 07:47 PM
Thanks :D I've changed it and it didn't seem to help my problem, but thank you anyway!

cg9com
04-03-2003, 07:58 PM
Originally posted by aurus_steelswor
I hate to sound impatient, but... have you found anything wrong with that yet? I'm kind of sitting in the dark here, so to speak... *blinks*
sorry about that, but i really dont see a problem with the coding, perhaps the problem lies elsewhere.

aurus_steelswor
04-03-2003, 10:06 PM
Well, thanks for looking over it, I appreciate it. :D