ronverdonk Posted September 17, 2006 Share Posted September 17, 2006 I have 3 scripts:A.PHP contains a form FORMA with a textarea where the user can enter his data. This form also has a button which tells the user that it, when clicked, enables him to see a pre-formatted display of his entered text in a SEPARATE window.Actually, when clicked, it opens a child window loading script B.PHP, which submits the form FORMA from A.PHP (using command opener.window.FORMA.submit(). Form FORMA is submitted using POST toC.PHP which processes the text and displays the formatted result.My problem is that the result is not shown in the child window, but in the opener window.How can I make it so that the C.PHP is run in the child window?Any help is much appreciated.Ronald 8) Quote Link to comment Share on other sites More sharing options...
degsy Posted September 18, 2006 Share Posted September 18, 2006 It is doing what you set it to do.using command opener.window.FORMA.submit()you are posting the parent, not the child. Quote Link to comment Share on other sites More sharing options...
ronverdonk Posted September 18, 2006 Author Share Posted September 18, 2006 Yes I understand that and I see that! But my question was: How can I make it so that the C.PHP is run in the child window?Ronald 8) Quote Link to comment Share on other sites More sharing options...
nogray Posted September 18, 2006 Share Posted September 18, 2006 When you open the window using window.open (or the way you open it) give it a name. Set your form target to the window name you assigned. Something like this[code]<button onclick="winobj = window.open('test1.html', 'win_name');">Click to open window</button><form method="get" target="win_name" action="test2.html" onsubmit="winobj.focus();"> <input type="submit" /></form>[/code] Quote Link to comment Share on other sites More sharing options...
ronverdonk Posted September 18, 2006 Author Share Posted September 18, 2006 Thanks a lot NOGRAY! This works, I had forgotten all about the 'target' attribute in my form. I only changed your sample GET to POST because GET only passes a maximum of 2083 chars under Windows.Thanks again.Ronald 8) 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.