Code does not redirect to another page

Asked

Viewed 60 times

0

The code below is working, but no else is not redirecting to another page with the window.location.assign().

function verifica() {
 if (document.forms[0].email.value.length == 0) {
  alert('Por favor, informe o seu EMAIL.');
  document.frmEnvia.email.focus();

  return false;
 }

 return true;
}

function checarEmail(){
 if( document.forms[0].email.value=="" 
    || document.forms[0].email.value.indexOf('@')==-1 
    || document.forms[0].email.value.indexOf('.')==-1 )
 {
   alert( "Por favor, informe um E-MAIL válido!" );
   return false;
 } else {
   window.location.assign('http://www.example.com')
 }  

}

1 answer

3

Browser other questions tagged

You are not signed in. Login or sign up in order to post.