I have this page, on which I have a button. The button does nothing more than
window.close(). But the problem is that the page contains a form onsubmit script, which checks to see if the sum of all dropdownlists equals 10.
So when I implemented the button to immediately close the window, it would trigger the submit on the form. To solve this, you have to write
window.close();return false; instead of just
You would think that when
window.close() executes, the form won’t do a submit… I didn’t think this was obvious, that’s why I made a post about it. Hope it’s useful to someone.