Neophyte question

Giganews Newsgroups
Subject: Neophyte question
Posted by:  fox (f…@connexions.net)
Date: Sat, 16 Sep 2006

Hi,

Looking through this forum, I cannot help to think that I am way over my
head. Meanwhile, I have a simple purpose and a $15 book on javascript.
Needless to say I need a bit of help. Can someone tell me why this
seems to consider every entered string to be "false" even when it is a
legit email address?

<script language="Javascript" Type="text/javascript">
function FrontPage_Form1_Validator(theForm)
{

  if (!(theForm.email.value.indexOf(".")) > 3 || !
(theForm.email.value.indexOf("@")) > 0);
  {
  alert("You did not enter a valid email address for the 1 \"email\"
field.");
  theForm.email.focus();
  return (false);
  }

  return (true);
}

</script>

Thanks to anyone who might be able to correct my problem,
Fox

Replies