The logic isn't actually correct, because [a] running preventDefault() on DOMContentLoaded isn't a thing (what default action would you be preventing?) and [b] there's no variable event in scope in your example (the global window.event is not present in all browsers) But the main problem is, as described on those other threads, you can only run window.open() in response to deliberate user interaction, i.e. it has to be part of continuous event handling after a mouse click. Loading a new page doesn't meet the security criteria for user-driven events; even if the new page navigation originated from a deliberate user-driven event, by the time the new page loads that context is lost. I recommend you load the follow-up content in the same page as the form, so the event handling can continue as usual.
... View more