...

View Full Version : Pulldown Redirect w/Target



SysRoute
12-06-2003, 09:21 PM
Ok, I've gotten as far as getting my pulldown menu setup and it redirects as it's supposed to. My problem is that I have an iFrame on the page that I would like one of the menu items to change when selected. The target iframe is named "navigator". Here is the code I have so far:

IN THE HEAD:

<SCRIPT LANGUAGE="JavaScript">

<!-- Original: Alex Tu <boudha1@hotmail.com> -->
<!-- Web Site: http://www.geocities.com/alex_2106 -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>


THE FORM ITSELF:

<FORM NAME="menufrm" ACTION="" METHOD=POST>
<DIV ID="Forms Combo Box1LYR">
<SELECT ID="Forms Combo Box1" NAME="menu1" onchange="submit(); return true" name="url" javascript:formHandler(this)>
<OPTION VALUE="" SELECTED>What's Your Function?</OPTION>
<OPTION VALUE="http://www.abbeyapartments.com/newsite/html/ipixapart.html">360 Virtual Tours</OPTION>
<OPTION VALUE="http://www.abbeyapartments.com/html/workorder.html">Submit Workorder</OPTION>
<OPTION VALUE="">Forms Download</OPTION>
</SELECT>
</DIV>
</FORM>


What might I be doing wrong? When I click the pulldown I get an error that says resource not allowed. Don't know what to do...

kwhubby
12-07-2003, 09:00 AM
well thats simple, you just change
window.location.href = URL;

to

window.navigator.location.href = URL;

ps. wow thats messy!, whats with 3 names for one element?!?!?, I dont even think that script there as it is would work...

SysRoute
12-07-2003, 05:25 PM
It's not my coding, you can see where I got it from. In either case, I made that change and it still doesn't seem to work. Does anyone know of a good javascript redirect for a pulldown menu. I've tried several and haven't gotten any to work. I know I had one back in the day but I can't find it...

Jason

SysRoute
12-07-2003, 05:39 PM
OK. I foudn out how I can accomplish the redirect. Here's the code I am now using: My initial question still remains, however, how can I get these links to open in a Target? I have a target iframe on the page name navigator. Any help is appreciated!

<FORM NAME="jump" ACTION="" METHOD=POST>
<DIV ID="Forms Combo Box1LYR">
<SELECT ID="Forms Combo Box1" NAME="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
<OPTION VALUE="" SELECTED>What's Your Function?</OPTION>
<OPTION VALUE="http://www.abbeyapartments.com/newsite/html/ipixapart.html">360 Virtual Tours</OPTION>
<OPTION VALUE="http://www.abbeyapartments.com/html/workorder.html">Submit Workorder</OPTION>
<OPTION VALUE="">Forms Download</OPTION>
</SELECT>
</DIV>
</FORM>

kwhubby
12-07-2003, 11:23 PM
as i said, if u were using a iframe as u said... ud go


instead of

location=document.jump.menu.options[document.jump.menu.selectedIndex].value;


it should be just... iframename.location.href=document.jump.menu.options[document.jump.menu.selectedIndex].value;

SysRoute
12-07-2003, 11:32 PM
Thanks for the help. I was using a different script the second time around and don't know enough to know what to change in order to make it work.

Thanks again.

SysRoute
12-07-2003, 11:51 PM
OK I implemented the change you recommended and the pulldown doesn't respond at all now. It doesn't give me an error at the bottom either. The link to it is as follows:

http://abbeyapartments.com/newsite/html/the_lifestyle.html

Thanks!

kwhubby
12-08-2003, 05:25 AM
that link gives a 404 error...

well of course this is if u have and iframe in the page... and u must change were it says iframename to whatever the iframe id / name is which u said earlier is navigator.

glenngv
12-08-2003, 05:43 AM
<SELECT ID="Forms Combo Box1" NAME="menu" onChange="url=this.options[this.selectedIndex].value;if(url)top.frames['navigator'].location.href=url">
<OPTION VALUE="" SELECTED>What's Your Function?</OPTION>
<OPTION VALUE="http://www.abbeyapartments.com/newsite/html/ipixapart.html">360 Virtual Tours</OPTION>
<OPTION VALUE="http://www.abbeyapartments.com/html/workorder.html">Submit Workorder</OPTION>
<OPTION VALUE="">Forms Download</OPTION>
</SELECT>


You can also use:

window.open(url, 'navigator')

instead of:

top.frames['navigator'].location.href=url



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum