Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Dec 2003
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Pulldown Redirect w/Target

    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...
    Jason Smith

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    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...
    Kris Hubby
    kwhubby site

  • #3
    New Coder
    Join Date
    Dec 2003
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Jason Smith

  • #4
    New Coder
    Join Date
    Dec 2003
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>
    Jason Smith

  • #5
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    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;
    Kris Hubby
    kwhubby site

  • #6
    New Coder
    Join Date
    Dec 2003
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Jason Smith

  • #7
    New Coder
    Join Date
    Dec 2003
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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/h...lifestyle.html

    Thanks!
    Jason Smith

  • #8
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    Kris Hubby
    kwhubby site

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts

    <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
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •