AS3: Simple email validation

[ 2010-08-12 14:25:21 | Author: liuhuan ]
Font Size: Large | Medium | Small
function validate(param1:TextField):Boolean {
  if (param1.text.length >= 7) {
    if (param1.text.indexOf("@") > 0) {
      if (param1.text.indexOf("@") + 2 < param1.text.lastIndexOf(".")) {
        if (param1.text.lastIndexOf(".") < param1.text.length - 2) {
          return true;
        }
      }
    }
  }
  return false;
}
Comments Feed Comments Feed: http://www.liuhuan.com/blog/feed.asp?q=comment&id=1083

There is no comment on this article.

You can't post comment on this article.