PopupWindow-> JS Validation -> PHP Mysql Update ->

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
appeet
Forum Newbie
Posts: 3
Joined: Wed Jul 27, 2005 3:11 pm

PopupWindow-> JS Validation -> PHP Mysql Update ->

Post by appeet »

Hello everyone.,

My scenario is as follows :
Main window opens a popup window->
User fills in data in popup window ->
User submits data in popup window using button with onclick call to javascript->
Popup window does JS validation and calls the form submit (which is associated to php)->
PHP does db update and displays a status message "Update successful"

My question is

Once PHP completes the update I want it to close the popup window. If there is an error in the update it is ok for it to stay up.

How can I do this. Any help will be highly appreciated.

Regards.,
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Try something like this:

Code: Select all

//untested
if($noError){
 echo '<script language="javascript">'."\\\n";
echo 'close();'."\\\n";
echo '</script>';

}
appeet
Forum Newbie
Posts: 3
Joined: Wed Jul 27, 2005 3:11 pm

Post by appeet »

It did not like the new line characters, so removed them.But this code worked. Thanks very much.
Post Reply