Form in one iFrame refreshes another iFrame

Reply

Join Date: Nov 2007
Posts: 119
Reputation: Roebuc is an unknown quantity at this point 
Solved Threads: 2
Roebuc's Avatar
Roebuc Roebuc is offline Offline
Junior Poster

Form in one iFrame refreshes another iFrame

 
0
  #1
Jun 19th, 2008
I have a page that holds two iFrames. The first iFrame is a form the user has to fill out. The second iFrame prints the results the form gives. When the page is first loaded with the two iFrames, I want the second to hold a default page that says "Please Fill Out The Form". Once they do and hit submit, I want the the second frame to change to the results. My form works, and when you first load the page it seems to work, however, once I hit submit, it sends to a new page that just shows the results. Please advise, thanks.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: Form in one iFrame refreshes another iFrame

 
0
  #2
Jun 19th, 2008
why are you using iframes?
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Form in one iFrame refreshes another iFrame

 
0
  #3
Jun 20th, 2008
Ya frames are sloppy, use ajax.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Form in one iFrame refreshes another iFrame

 
0
  #4
Jun 20th, 2008
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 119
Reputation: Roebuc is an unknown quantity at this point 
Solved Threads: 2
Roebuc's Avatar
Roebuc Roebuc is offline Offline
Junior Poster

Re: Form in one iFrame refreshes another iFrame

 
0
  #5
Jun 20th, 2008
The way the link shows is how I thought I was suppose to do it, but it doesn't work. Here are the iFrames......

  1. <td width="580" valign="top" align="center">
  2. <iframe name="LinkBackForm" width="600" height="400" align="middle" src="linkForm.php" frameborder="0" ></iframe>
  3. </td>
  4. </tr>
  5. <tr align="center">
  6. <td width="580" valign="middle" align="center">
  7. <iframe name="URL" width="500" height="200" align="middle" src="functions/linkBackCode.php" frameborder="1"></iframe>
  8. </td>

Here is the first line of the form....

  1. <form action="functions/linkBackCode.php" method="get" target="URL" >

I am not sure what I might be doing wrong with it. The page that houses the iFrames is ...getLinkBack.php. I then have my functions under another folder obviously and I have the form send the info to the linkBackCode.php. In that file, if there is not new URL, it post the phrase "PLEASE FILL OUT FORM". Once someone fills out the form, I want it to refresh that iFrame, not open a new window with the new call. Does that make sense? Thanks for the help.
Last edited by Roebuc; Jun 20th, 2008 at 4:10 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Form in one iFrame refreshes another iFrame

 
0
  #6
Jun 20th, 2008
I ran a test and it works for me, here is my code
file:test.php
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <table>
  10. <tr>
  11. <td width="580" valign="top" align="center">
  12. <iframe name="LinkBackForm" width="600" height="400" align="middle" src="test1.php" frameborder="0" ></iframe>
  13. </td>
  14. </tr>
  15. <tr align="center">
  16. <td width="580" valign="middle" align="center">
  17. <iframe name="URL" width="500" height="200" align="middle" src="test2.php" frameborder="1"></iframe>
  18. </td>
  19. </tr>
  20. </table>
  21. </body>
  22. </html>

file:test1.php
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <form target="URL" action="test2.php" method="get">
  10. <input type="text" name="txtOne" /><br />
  11. <input type="text" name="txtTwo" /><br />
  12. <input type="submit" name="btnSubmit" />
  13. </form>
  14. </body>
  15. </html>

file:test2.php
  1. <?
  2. if(count($_POST) > 0)
  3. {
  4. print_r($_POST);
  5. echo "<br />";
  6. }
  7. if(count($_GET) > 0)
  8. {
  9. print_r($_GET);
  10. echo "<br />";
  11. }
  12. ?>
  13.  
  14. This is frame 2
Last edited by R0bb0b; Jun 20th, 2008 at 4:36 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC