Why a opened popup window can't submit a form and then close itself? If I comment the close sentence, the submit runs
Apr 4th, 2008 21:06
ha mo, Arsen Yeremin, Juergen Thelen, Néstor Palacios,
I guess you do a .submit(), almost immediately followed by a .close().
If so, you got trapped by the asynchronous behaviour of the .submit()
wait until the submission is finished. Instead it will continue with
the next line in your script.
If one of these next lines is a window.close() all running/pending
transmissions are immediately canceled, even your form submission, if
not already finished...
Usually a short delay of a few seconds will help. Use
Another solution would be is to put a
on the page you are submitting to.
That way if they are on a slow connection, or the submit takes longer
than expected the window will close on completion of the submit.