Page 1 of 1

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

Posted: Wed Jul 27, 2005 3:17 pm
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.,

Posted: Wed Jul 27, 2005 3:33 pm
by hawleyjr
Try something like this:

Code: Select all

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

}

Posted: Wed Jul 27, 2005 3:48 pm
by appeet
It did not like the new line characters, so removed them.But this code worked. Thanks very much.