Page 1 of 1

on iFrame_1 link click change iFrame_2

Posted: Wed Apr 27, 2005 12:04 pm
by Jr
Basically I just dont know how to update one I frame onClick of a link from another.

This is the situation:
I have a page that has 2 iFrames and I wanted to make it so one pulls data from a table and makes a list of links. Then onClick of one of the links the second iFrame queries data corrisponding to the ID (or whatever) and pulls from a different table and shows the corrisponding information.

Posted: Wed Apr 27, 2005 12:36 pm
by Jr
I found this but it updates the first iFrame on the test_2.php page for some reason when the link on test_3.php is clicked. I don't know any JavaScript so I really dont know what to look for here can someone help?


test_2.php:

Code: Select all

print &quote;<iframe src='test_3.php' name='base_iframe'></iframe>&quote;;
print &quote;<br><iframe src='about:blank' name='content_iframe'></iframe>&quote;;
test_3.php:

Code: Select all

print &quote;<a href='#' onclick=\&quote;parent.frames&#1111;0].location ='home.php';return false\&quote;><img src='image/edit.gif' width='50' height='50' border='0' /></a>&quote;;

Posted: Wed Apr 27, 2005 2:07 pm
by shiznatix
not to sure what your asking but you want to be able to click on a link in 1 iframe and have it open in the other iframe rite? well then just name your iframes
<iframe name=frameA> and <iframe name=frameB> then on the links in frameA do target='frameB'> and the links in frameB do target='frameA'>

hope that helps

Posted: Thu Apr 28, 2005 12:16 am
by ol4pr0
I believe he means passing on variables from one frame to another frame.

If that is true:

In that case. the most easy way to accomplish that is to pass vars trough the url either encoded or whatever using $_GET / $_REQUEST to retrieve them. SESSIONS dont really work i believe.. since using SESSIONS to jump screens isnt such a good idea.

Posted: Thu Apr 28, 2005 11:05 am
by Jr
just named them.

Thanks...