hyperlink problem

  •  01-07-2008, 7:57 AM

    hyperlink problem

    Hello, i have a small hyperlink problem. I needed to add a dropdown to all the pages that allowed the user to create hyperlinks. Now instead of rewriting the javascripts or creating new dialog popups, i solved the problem with creating a small javascript, that checks the dropdown, if it has a value, then move that value to the inp_src field (URL). It worked perfect for the imagemap page, but i cant figure out how to get it to work with the hyperlink popup page Dialog->Tag->Tag_a.ascx. I have gone thru that page but since the buttons are loaded from another page, it makes it very difficult. Also since the page loads diffrent javascript on diffrent occations, its hard to find out where to put it.
     
    These are the small code blocks that i added:

    Dropdown that they can select a hyperlink from (this is automatically loaded, works perfect)
    <select name="intern_dropdown" id="intern_dropdown">
     <option selected="selected" value="">Ange i fältet nedan</option>
     <option value="template1.aspx">Sida1</option>
     <option value="template2.aspx">Sida2</option>
     <option value="template3.aspx">Sida3</option>
    </select>  
     
    This is the BLOCKED SCRIPT
    <script language="javascript" type="text/javascript">
     function check_dropdown()
     {
         var mVal = document.getElementById("intern_dropdown");
         if (mVal.selectedIndex == -1) return;
         var mUrl = document.getElementById("inp_src");
         if (mVal.options[mVal.selectedIndex].value == "") return;
         mUrl.value = mVal.options[mVal.selectedIndex].value;
     }
    </script>
     
    And then the last line of code:
    <input class="inputbuttoninsert" type="button" value="[[Insert]]" style="width: 80px" onclick="check_dropdown();insert_link()" />
     
    This works on the Imagemap page, but not on the Hyperlink page since it have the button located on another page. I have tried chaingching both pages, but with no luck.

    Any ideas of where to put it?, i have tried in the javascript and on the page =/
View Complete Thread