Posted By

todbertuzzi on 01/11/08


Tagged

email validator


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

akashaman


check Mail [F8/ AS2]


 / Published in: ActionScript
 

  1. function mailTrue(mailType:String):Boolean {
  2. var t:String = mailType;
  3. var tmpArray:Array = t.split("@");
  4. if (tmpArray.length != 2) {
  5. trace("ARRAY NON VALIDO");
  6. return;
  7. }
  8. trace("continuo a STEP 1");
  9. var tLen:Number = tmpArray[1].length;
  10. var tmpChar = tmpArray[1];
  11. var tmpCharZero = tmpArray[0].length
  12. if (tLen<2 || tmpCharZero<2) {
  13. return;
  14. }
  15. trace("continuo a STEP 2");
  16. for (var i:Number = tLen; i>0; i--) {
  17. if (tmpChar.charAt(i) == ".") {
  18. trace("TROVATO DOT");
  19. newPoint = i;
  20. afterDot = tmpChar.substr(newPoint, tLen);
  21. (afterDot.length>=2) ? (myValue=true) : (myValue=false);
  22. trace("continuo a STEP 3");
  23. break;
  24. }
  25. }
  26. return myValue;
  27. }

Report this snippet  

You need to login to post a comment.