We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14712
    • 4 Posts
    Hi There,

    I created a dropdown menu for internal navigation within a category that works perfectly fine in firefox but not IE.

    In firefox when you choose an option it takes you to the correct URL e.g. http://travelandcruisedeals.com/cruiselines/azamara/info

    In IE it doesnt go to the correct URL e.g http://travelandcruisedeals.com/cruiselines/princess/cruiselines/azamara

    Instead of going to the full url it adds on the parent/child url of the new link while keeping the parent/child of the old

    CODES


    <script language="JavaScript">
    function jumpTo(selObj){
    thevalue = selObj.options[selObj.selectedIndex].value;
    if (thevalue != 0) window.location= thevalue;
    return false
    }
    </script>

    <form action="#" onsubmit="return false" method="post">
    <select name="goto" onChange="jumpTo(this);">
    <option value="please choose one">Please choose one</option>
    [!Ditto? &parents=`5` &tpl=`dropdown-option` &display=`100` &total=`100` &sortBy=`pagetitle` &sortDir=`ASC`!]
    </select>
    </form>

    & DROPDOWN-SELECT

    <option value="[~[+id+]~]">[+pagetitle+]</option>



      • 14712
      • 4 Posts
      I solved it a few minutes later by using [+url+] instead of the ID tag. Can anyone explain to me why it works this way but not the other?
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        Perhaps the ID link didn’t contain a starting slash?


        I’d advise to always use [tt]<base href="[(base_url)]"></base>[/tt] in your header and use urls relative from the site root to avoid things like this.
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.