Results 1 to 3 of 3

Thread: Need help revising JS to accept url variable

  1. #1
    Join Date
    Jan 2009
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Need help revising JS to accept url variable

    I have this script and select box already working on a CFMX7 site
    What I need is to add a ##Track%20Name to the src to pass the"Name anchor"
    to the content page of the Iframe to force where it opens the page within the Iframe.

    <script>
    function updateContent() {
    var foodd = document.getElementById("foo");
    var foovalue = foodd.options[foodd.selectedIndex].value;
    if(!foovalue) return;
    var myframe = document.getElementById("myiframe");
    myframe.src = "ilayer.cfm?id="+foovalue;
    }
    </script>

    I tried this to set the anchor tag and it killed the script:

    myframe.src = "ilayer.cfm?id="+foovalue;&##Track%20Name"
    The second # is to close # in coldfusion, it works fine outside of the script
    The ID portion must stay as it forwards the select VAR to receiving page
    for the sql query

    Does the script need to be modified to work?

    Thanks in advance for any help,
    Working script here:
    www.woostatserver.com/laps/default4.cfm

    Any other suggestion appreciated,
    Steve
    Last edited by slamothe; 03-01-2009 at 02:12 PM. Reason: better clarification

  2. #2
    Join Date
    Jan 2009
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I thought this would be a pretty simple revision,(for someone who knows how) LOL
    Have I asked the question or stated my need clearly?
    If I need to re-state to make it clearer please let me know,
    Thanks,
    Steve

  3. #3
    Join Date
    Jan 2009
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Lightbulb Resolved

    Just looked how other issues were resolved and just started hacking, finally got it right!!

    added:

    var anchorvalue = "##track";
    myframe.src = "laps.cfm?id="+foovalue+anchorvalue;

    Now I'm a coder!!
    LOL

Bookmarks

Posting Permissions

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