By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,818 Members | 958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,818 IT Pros & Developers. It's quick & easy.

Passing variable to iframe

P: 3
I am having trouble exercising this function, and wondered whether anyone would be kind enough to help.


I have a php/mysql output that i would like to pass to an iframe in order for a form to work better.

This is my code;

Expand|Select|Wrap|Line Numbers
  1. function countyChanged(name)
  2. {
  3. if(frames['editregion'].document.r1.r2.value)
  4.   {frames['editregion'].document.r1.r2.value = name;}
  5.     document.getElementById('listingsearch'+'r1').submit();
  6. }
The
Expand|Select|Wrap|Line Numbers
  1. ('listingsearch'+'r1' )
is my problem, as I can get the variable to pass using a simple form and submit button, but it doesn't work using the onChange command, so I have tried this so as to get the variable passed and the iframe page to refresh in order to activate the php function in the iframe.

Sorry if this sounds confusing.

Can anyone help?
thanks
Feb 11 '07 #1
Share this Question
Share on Google+
2 Replies

P: 3
I managed to fix this problem by changing the onchange command to include value in its operator.

So, I got the variable passed to the iframe, and now the function can display its new selection. Now, I need to pass the new variable back to the parent and to another iframe, where it can perform the same thing.

Can anyone offer an idea?

thanks
Feb 11 '07 #2

acoder
Expert Mod 15k+
P: 16,027
See this page for accessing iframes.
Feb 12 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.