My question is a combination of PHP, Javascript and HTML.
Overview, I have a form the user fills out... they go through all the pages to the end. I'm passing my php variables (the main chunk is built in php) throughout so at the end they click the submit button and the information is loaded into a database.
What I'd like to have happen when the user presses the submit button is the following:
Little window popups... gif flashes saying the page is working... after a set time the popup closes and the parent window redirects to a thank you page.
The button is defined thusly:
<input TYPE='submit' name='buttonname' value='Submit Registration' onclick="Completewin()" >
(The CompleteWin function is this:
function Completewin()
{
window.open('submitregistration.php','jav','scrollbars=yes,status=no,toolbar=no,resizable=no,width=800,height=800,top=150,left=185');
setTimeout('document.location = "thankyou.php"',5000)
})
This works in a way. The popup window appears (it's big here so I can view it). However, the parent window also redirects to the submitregistration.php page... which I do not want to happen. I want it to remain on the calling page before it's redirected to thankyou.php.
IF I change the HTML tag to:
<Input Type="button" .... >
Then the parent page stays as it is, and after the set time redirects to thankyou.php. HOWEVER, using button, my php variables do not pass to the submitregistration.php page, so they cannot be loaded into the database.
Ugh.
I would love some help. I've been googling all day and haven't found the answers I need. Thanks!