I have a popup that contains a form. When I submit that form, I need 1) the data to get saved into my database, 2) the popup to close, and 3) the parent window to refresh and display the updated data.
I found the following code in an old thread, but the parent window still shows the old data after it appears to reload. The data is saved in the database, but the parent window only shows the updated data when I manually refresh it by hitting F5.
Thanks ScallioXTX, I was wondering about the order of operations so to speak, so that helps. I’m trying to get it to submit the form then reload the parent then close, but this approach isn’t working either:
<script type='text/javascript'>
function submitform() {
document.myform.submit();
window.opener.location.reload(true);
self.close();
}
</script>
The form does submit but the parent doesn’t reload and the popup doesn’t close. If I comment out the form submit line, the parent does reload and the popup does close. Any insight is appreciated.
Has anything with the opener page changed prior to the call (such as the page having been previously reloaded)? If the page in the opener window changes in any way then the opener link between the two windows is broken.