View Full Version : Drop Down Menu That Targets Frames


wildmex
01-27-2003, 09:21 PM
Hello all,

On the Fun Stuff page on the site you have code for "Drop Down Menus That Target Frames" and also "Drop Down Menus with the "Go" button on the side of the Menu". But, the page does not have a combined code for "Menus that Target Frames w/ the "Go" button on the side", I don't know if I'm making myself clear. Please I need help with this.

Basically, I need a drop down menu that targets frames, but I want it to fire when I click the "go" button, I don't want it to be automatic. If anybody knows the code for this please email me or post it on here. Thanks.

Alcy
01-27-2003, 10:47 PM
Hehe, sorry. You have to add onchange="jump(this.form)" to the dropdown and change some of the names in the script:

<script language="javascript">
function jump(form) {
var myindex=form.lissamenu1.selectedIndex
if (form.lissamenu1.options[myindex].value != "0")
{
window.open(form.lissamenu1.options[myindex].value,
target="_blank");
}
}
//-->
</script>

<form name="gotolocation1" method="POST">

<select name="lissamenu1" onchange="jump(this.form)">

<option value="http://www.google.ca">1</option>
<option value="http://www.google.ca">2</option>
<option value="http://www.google.ca">3</option>

</select>

<input type="button" onchange="jump(this.form)" onClick="location = document.gotolocation1.lissamenu1.options[document.gotolocation1.lissamenu1.selectedIndex]..value;" value="Go">

</form>

wildmex
01-28-2003, 12:12 AM
Thanks for the suggestion. However, this is how the code you gave me works:

The items on the menu target my frames "on click", which I'd rather not have it work that way. I would like it where you can select an item on the menu but then have to click "go" in order to access the frame. The "go" buton still doesn't work with the frame.



If you have any other suggestions, please let me know.

Alcy
01-28-2003, 02:15 AM
You have to change the target so that it targets your frame and not to "_blank" (a new page).

<script language="javascript">
function jump(form) {
var myindex=form.lissamenu1.selectedIndex
if (form.lissamenu1.options[myindex].value != "0")
{
window.open(form.lissamenu1.options[myindex].value,
target="yourframename");
}
}
//-->
</script>

<form name="gotolocation1" method="POST">

<select name="lissamenu1" onchange="jump(this.form)">

<option value="http://www.google.ca">1</option>
<option value="http://www.google.ca">2</option>
<option value="http://www.google.ca">3</option>

</select>

<input type="button" onClick="location = document.gotolocation1.lissamenu1.options[document.gotolocation1.lissamenu1.selectedIndex]..value;" value="Go">

</form>

wildmex
01-28-2003, 05:28 PM
Yes, I knew to do that much, but it doesn't work.

I appreciate your help, if you can figure it out let me know.

Alcy
01-28-2003, 05:41 PM
Oh, I see what you're talking about. I didn't understand at first :p

"onchange", should be changed to "onclick"

<form name="gotolocation1" method="POST">

<select name="lissamenu1">

<option value="http://www.google.ca">1</option>
<option value="http://www.google.ca">2</option>
<option value="http://www.google.ca">3</option>

</select>

<input type="button" onClick="jump(this.form)";"location = document.gotolocation1.lissamenu1.options[document.gotolocation1.lissamenu1.selectedIndex]..value;" value="Go">

</form>

wildmex
01-28-2003, 06:04 PM
Yes!

Thank you!

rsbblue
01-25-2005, 01:37 PM
I am trying to set up a drop down menu that targests a frame page.

Please tell me how to get to the Fun Stuff page so I can read the whold subject.


You may e-mail me at
^^^^brom@att.net

many thanks

Hello all,



On the Fun Stuff page on the site you have code for "Drop Down Menus That Target Frames" and also "Drop Down Menus with the "Go" button on the side of the Menu". But, the page does not have a combined code for "Menus that Target Frames w/ the "Go" button on the side", I don't know if I'm making myself clear. Please I need help with this.

Basically, I need a drop down menu that targets frames, but I want it to fire when I click the "go" button, I don't want it to be automatic. If anybody knows the code for this please email me or post it on here. Thanks.

Sheila
01-25-2005, 01:40 PM
I am trying to set up a drop down menu that targests a frame page.

Please tell me how to get to the Fun Stuff page so I can read the whold subject.


You may e-mail me at
^^^^brom@att.net

many thanks

http://www.lissaexplains.com/fun.shtml#dropframe