pakenney38 Posted November 13, 2007 Share Posted November 13, 2007 THE GOAL: Open child.php with the link on main.php. Fill out the form on child.php and submit the form variable back to main.php in the window that is already open. Close the window for child.php automatically after it submits the form. Display the contents of the variable on main.php. THE PROBLEM: This is just a little test that I am putting together to incorporate into a larger project. I have had many years of experience with HTML and a couple with PHP, but I am starting to jump into combining this with Javascript and of course now I am running into browser specific issues. The following code works in IE 7 fully, but does not display the variable back on main.php using Mozilla 2.0. Possibly, the form variable is never even sent to the page (no way to prove or disprove that with my skill level). [main.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script type="text/javascript" language="javascript"> self.name = 'main'; </script> <style type="text/css"> <!-- .style1 {font-family: Verdana, Arial, Helvetica, sans-serif} --> </style> </head> <body> <a href="child.php" target="child" onclick="window.open('child.php', 'child'); return false" class="style1">link</a><br /><br /> <font class="style1"> <?PHP $textfield = $_POST['textfield']; echo $textfield ?> </font> </body> </html> [child.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <SCRIPT LANGUAGE="JavaScript"> function closeWindow() { //Firefox if (navigator.appName == 'Netscape') { window.open('', '_self', ''); window.close(); } else //Internet Explorer setTimeout("WB.ExecWB(45,2)",0); } </SCRIPT> <OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"> </OBJECT> <style type="text/css"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; } --> </style> </head> <body> <form action="main.php" method="post" name="form1" target="main" id="form1" onsubmit="closeWindow()"> <label><span class="style1">Enter Variable</span> <input type="text" name="textfield" /> </label> <p> <label> <input type="submit" name="Submit" value="Submit" /> </label> </p> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
pakenney38 Posted November 15, 2007 Author Share Posted November 15, 2007 Apparently no one cares to do this other than me? Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted November 16, 2007 Share Posted November 16, 2007 your needing a javascript pop-up "remote control". try these search results: http://www.google.com/search?hl=en&q=Javascript+Remote+Control&btnG=Search Quote Link to comment Share on other sites More sharing options...
pakenney38 Posted November 19, 2007 Author Share Posted November 19, 2007 The examples are a more simplified version of what I am looking for. I want to be able to open up a smaller window with a form in it and submit the form variables back to the parent window. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.