• 0
Sign in to follow this  
Guest - dani -

Validar Mail

Question

Guest - dani -

tenho este codigo aqui:

<script language="javascript">

function envia() {

document.form.action = "personaldata.asp?client=true";

document.form.submit();

}

function checar() {

if (document.form.name.value == "") {

  alert('Fill the field name.');

  document.form.name.focus();

  return(false);

}

if (document.form.address.value == "") {

  alert('Fill the field Address.');

  document.form.address.focus();

  return(false);

}

if (document.form.city.value == "") {

  alert('Fill the field City.');

  document.form.city.focus();

  return(false);

}

if (document.form.country.value == "") {

  alert('Fill the field country.');

  document.form.address.focus();

  return(false);

}

if (document.form.zip.value == "") {

  alert('Fill the field ZIP.');

  document.form.zip.focus();

  return(false);

}

if (document.form.email.value == "") {

  alert('Fill the field E-mail.');

  document.form.email.focus();

  return(false);

}

if (document.form.email.indexOf('@', 0) == -1 || email.indexOf('.', 0) == -1){

    alert("Este e-mail não é válido!");

      document.form.email.focus()

      return false

}

}

</script>

queria que ele verifica-se se o mail é valido mas não faz isso e dá seguimento mesmo errado, gostava de saber onde está o problema. vlw

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this