I have a submit button with a onClick:
&
I spent 2 days trying every solution shown here and elsewhere, to no avail. Then I removed the form tags, which served no purpose since there was no submit button, and the problem went away using:
form
submit
window.location = 'mypage.php', true;