Jump to content

[SOLVED] How submit a form in opener window and run in child window?


ronverdonk

Recommended Posts

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 to
C.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)
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.