K
Kevin N
Hello,
It seems that the form submit() function runs asyncronously on Chrome
and Safari (Windows version); for example if I have a window created
with open() containing a form, MyForm, and a button with onclick
handler MyFormSubmit() as follows
function MyFormSubmit() {
// validate form data here
// submit the form and close the popup window
document.MyForm.submit();
window.close();
}
Now this works fine on Firefox 3.x, IE (6,7,8), Opera 9.x: the data is
sent to the server and the popup window closes. On Chrome and Safari,
it does not. The popup window is closed with nothing being submitted
to the server. It seems this is an issue with submit running
asyncronously on Chrome. For example if I insert code between the
submit() and close() that will take a few milliseconds to run, or add
a setTimeout to call the close(), Chrome and Safari will work fine.
This is not urgent, since we do not intend to support those two
browsers anyway, but it would be nice to know the proper way to code
this in a way that will work on all the browsers I mentioned (besides
the two hacks I mentioned).
It seems that the form submit() function runs asyncronously on Chrome
and Safari (Windows version); for example if I have a window created
with open() containing a form, MyForm, and a button with onclick
handler MyFormSubmit() as follows
function MyFormSubmit() {
// validate form data here
// submit the form and close the popup window
document.MyForm.submit();
window.close();
}
Now this works fine on Firefox 3.x, IE (6,7,8), Opera 9.x: the data is
sent to the server and the popup window closes. On Chrome and Safari,
it does not. The popup window is closed with nothing being submitted
to the server. It seems this is an issue with submit running
asyncronously on Chrome. For example if I insert code between the
submit() and close() that will take a few milliseconds to run, or add
a setTimeout to call the close(), Chrome and Safari will work fine.
This is not urgent, since we do not intend to support those two
browsers anyway, but it would be nice to know the proper way to code
this in a way that will work on all the browsers I mentioned (besides
the two hacks I mentioned).