PDA

View Full Version : Resolved Need help revising JS to accept url variable



slamothe
02-26-2009, 08:23 PM
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

slamothe
02-27-2009, 08:27 PM
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

slamothe
03-01-2009, 02:10 PM
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