geniajanssen — 2011-05-04T21:18:04-04:00 — #1
I am trying to do two things. I have PDF files but the user has to click on the icon and a contact form will come up in a pop-up window. That window has a form and once the form is completed and properly validated, I want the pop-up window to automatically close and go to "white_papers.com?download=1". It will do everything but it only goes to white_papers.com. How can I get it to go to the entire URL including "?download=1"? The link is http://www.sagacent.com/white_papers.com.
paul_wilkins — 2011-05-04T21:56:36-04:00 — #2
By specifying the entire URL as the action attribute of the form.
geniajanssen — 2011-05-05T12:16:17-04:00 — #3
That won't work on my part. I have the form that I am using to collect information in a popup window. What I want to do is, once all information entered is correct, is to close the popup window and go back to the original page with the "white_papers.php?download=1". Putting this as an action in the form tag will load that page in the popup window. I want the popup window to close and then use the URL above redirected.
geniajanssen — 2011-05-05T12:29:16-04:00 — #4
Here is more detail. When all data is validated and everything is don in the popup window, I use the code :
The popup window closes but window.location.href does not execute.
If I remove window.close(), that line works but the popup window does not close and the file loads in the popup window. How do I fix this?
paul_wilkins — 2011-05-05T16:55:29-04:00 — #5
Typically the child window is not allowed to make changes to the parent.
What can be done though is for the child to execute a script that exists in the parent.
Have a function in the parent that changes the location. Then from the child, have it call that parent function just before the child closes itself.
geniajanssen — 2011-05-05T18:31:41-04:00 — #6
Can you give me some example files doing this?
paul_wilkins — 2011-05-05T18:38:45-04:00 — #7
Here are some examples:
So if your parent window had a function called afterChildSubmit() your child window could call that parent function and then close the child with: