Issue with Javascript form validation and url redirection

HI all,

So I’m setting up a test site for a project and it requires the user entering their name and email into a form, once that form validates (just verifies it’s not blank) I need the form to redirect them to another page. I have the validation working but not the url redirect.

Here’s my form HTML <form class=”form-container” name=”myForm”


<div class=”form-title”>Name</div>

<input class=”form-field” type=”text” name=”Name” />

<div class=”form-title”>Email</div>

<input class=”form-field” type=”text” name=”Email” />

<div class=”submit-container”>

<input class=”submit-button” type=”submit”/>




And here’s my js

// Form validation code will come here.

function validate()


if( document.myForm.Name.value == “” )


alert( “Please provide your name!” );

document.myForm.Name.focus() ;

return false;


if( document.myForm.Email.value == “” )


alert( “Please provide your Email!” );

document.myForm.EMail.focus() ;


window.location = “”


Any help you could give would be great!