Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-19-2002, 01:53 PM   PM User | #1
tinabme
New to the CF scene

 
Join Date: Jul 2002
Location: Florida
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
tinabme is an unknown quantity at this point
Trouble maintaining state of a variable being passed via query string

Hello,

I am trying to update an iframe when the user makes a selection from a select box.

I don't have any trouble with changing the iframe, but when I try to send a varible as a quey string, the variable doesn't pass to the iframe properly.

// this is in my header, and it is initiated from the onchange below.
// it changes the page fine, but doesn't read the varible "num"
// that was passed to the function

<script language="javaScript">
<!--
function updatenotes (num) {
document.getElementById("desc").src = 'iframe1.cfm?dec=num'
}
//-->
</script>

// this is the select box that initiates the function from onchange
// for simplicities sake, I hard coded 3 options, but in reality,
// these options are ever changing

<select name="Description" onchange="updatenotes(this.options[selectedIndex].value)">
<option name="">Select a project</option>
<option name="2" >project2</option>
<option name="3" >project3</option>
</select>

Any help you can offer would me ver appreciated.
thanks
tinabme is offline   Reply With Quote
Old 07-19-2002, 02:18 PM   PM User | #2
x_goose_x
Regular Coder

 
Join Date: Jun 2002
Location: Montreal, Canada
Posts: 644
Thanks: 0
Thanked 0 Times in 0 Posts
x_goose_x is an unknown quantity at this point
try:

document.getElementById("desc").src = 'iframe1.cfm?dec='+num
x_goose_x is offline   Reply With Quote
Old 07-19-2002, 02:41 PM   PM User | #3
tinabme
New to the CF scene

 
Join Date: Jul 2002
Location: Florida
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
tinabme is an unknown quantity at this point
Question thanks but that doesn't work

Thanks, but I did try that, and when the page is sent, the variable (querystring) is just left blank. any other ideas?
tinabme is offline   Reply With Quote
Old 09-05-2009, 11:28 AM   PM User | #4
searcyemily
New to the CF scene

 
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
searcyemily is an unknown quantity at this point
So you can't be bothered to explain why but we are supposed to be bothered to help? Just as well we are not as lazy as you.

As havoc said the font tag is one way but inline styles are more acceptable these days. Just echo the style="color:red;" bit inside the HTML tag.

And this is absolutely brilliant. Really your post is very good for clearing my concepts. Recently i have finished my 1z0-052 exam, which i appear for attaining the certification. Although! it was not so hard to get certified but the study kept me busy whole summer. I've also attained certification of another course of XK0-002 exam which I had passed last three months back. In the same time I have completed my thesis project of 70-444 exam which I will going to submit it soon. I really enjoyed my stay over here and gain useful knowledge which I am sure will work for me.
searcyemily is offline   Reply With Quote
Old 09-05-2009, 07:58 PM   PM User | #5
ckeyrouz
Senior Coder

 
ckeyrouz's Avatar
 
Join Date: Jun 2009
Location: Montreal, Canada
Posts: 1,044
Thanks: 5
Thanked 179 Times in 179 Posts
ckeyrouz is on a distinguished road
what is the object with id "desc", is it a frame or iframe or what?

After checking the initial post I saw it is an iframe so you try this:

Code:
parent.frameName.location.href = 'iframe1.cfm?dec='+num
__________________
Software and cathedrals are much the same - first we build them, then we pray.
ckeyrouz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:09 PM.


Advertisement
Log in to turn off these ads.