View Single Post
  #2 (permalink)  
Old 23rd March 2009, 16:38
405hp's Avatar
405hp 405hp is offline
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,272
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Depends

In this context it works ok. If you want to call it from some other place in your code it won't be visible due to scope.

BTW validate_email($this->vEMail is not js.

FWIW Here is an email validation that uses regular expressions.
Code:
var sendto=prompt ('Enter your email address');
if ((sendto != null) && (sendto != ""))
  {
  emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;
  if (!emailRe.test(sendto.toLowerCase()))
      {
      alert(sendto + ' is an invalid email.');
      return(false);
      }
Reply With Quote
Sponsored Links