Check out this link:
http://humorjots.com/Barry/BarryWashington.htm
The part in the script that says:
if(emailInput.value != '' && zipInput.value != ''){
window.location = "sea206.html";
}
for some reason doesn’t work in loading sea206.html. However when you go to type window.location = 'sea206.html' in the developers console, it loads the page. I don’t understand why it won’t work when the button is clicked.
The if statement does work. If an alert is inserted within the statement, it runs run when the button is clicked.
What happened on your code was it performs the default function of button on which will automatically submits the form.
Solution to this is that you must add return false on your submitButton.onclick function so that it will not submit the form and redirects to your desired location