Submitting a form and closing popup

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davidhopkins
Forum Commoner
Posts: 41
Joined: Thu Jun 10, 2010 7:52 am

Submitting a form and closing popup

Post by davidhopkins »

Hello all.

Firstly im not 100% sure if this is the right section on the forum to post under but not am not sure where else to put it so here goes...

I am using GreyBox to launch popups on my website, this all works well the popup is called by

Code: Select all

<a href="../pop/create.php" title="Create" rel="gb_page_center[530, 460]">Launch</a>
The page that is then loaded into the popup is a page hosted on my server and it simpy displays a form to allow the user to add some data into a database, this is all fine and works perfect. My form code is

Code: Select all

<form id="new" name="new" action="../scripts/create-ex.php" method="post">
<label class="LoginLabel">Reference:</label>
<br>
<input id="newRef" class="LoginTextArea" type="text" tabindex="1" name="newRef">
<br>
<label class="LoginLabel">Title:</label>
<br>
<input id="newTitle" class="LoginTextArea" type="text" tabindex="1" name="newTitle">
<br>
<input name="" type="submit" value="Create" tabindex="3" class="LoginButton"/><br>
</form>

My problem is thou because ytou click the submit button from inside the popup, when the create-ex.php action has been run it was suppose to redirect the user back to the homepage displaying all their added data, however now because its being called from inside the popup, the page being shown in the popup is being changed. I need to somehow close the popup and redirect the main page again.

Any ideas ?
Many Thanks =]
Post Reply