JavaScript automatic check function (2) -email verification

xiaoxiao2021-03-06  49

Speaking of this function, everyone has seen it, and the master dismissed. This is mainly written for those primary networks. I hope I can have a little force to make those beginners bend less. . . I am not writing this by this calibration function. I hope to have a better renewal. . . Thank you. . . . .

/ *** Checkemail function verifies whether this box is input for the Email type data, the returned value is true and false, true and false; ** Object target object, Desc Chinese description. * /

Function Checkemail (Object, DESC) {

Var pattern = /[A-ZA-Z0-9_.] 2, }@[a-za-z0-9_] 2, }.[A-ZA-Z0-9_] 2, }/;

Var strval = Object.value;

IF (Strvalue.Length == 0)

Return True;

IF (strValue.match (pattern) == null) {

Alert ("" desc "" must be legitimate Email, please modify! ");

Object.focus ();

Return False;

} else {

Return True;

}

}

转载请注明原文地址:https://www.9cbs.com/read-82525.html

New Post(0)