Form Verification-Email verification, form verification email
Email Verification
1. Using function Functions
Note: You need to add the attribute onblur = "loginEmailBlur (this. value)" to the <input> tag of the Code )"
Function loginEmailBlur (strEmail) {var loginEmail = $. trim ($ ("input [name = 'email ']"). val (); if (loginEmail = null | loginEmail = 'mail' | loginEmail = "") {$ (". smtwarning "). empty (). text ("your email account forgot to enter");} else {if (strEmail. search (/^ \ w + (-\ w +) | (\. \ w +) * \ @ [A-Za-z0-9] + ((\. |-) [A-Za-z0-9] + )*\. [A-Za-z0-9] + $ /)! =-1) {$ (". smtwarning "). empty (); return true;} else {$ (". smtwarning "). empty (). text ("enter the correct email format ");}}}
2. Write in $ (document). ready (function ()
// Form Verification in the login box var $ loginEmail = $ ("input [name = 'email ']"); var $ export warning = $ (". smtwarning "); $ loginEmail. blur (function () {var loginEmail = $. trim ($ ("input [name = 'email ']"). val (); if (loginEmail = null | loginEmail = 'mail' | loginEmail = "") {$ export warning. empty (). text ("your email account forgot to enter");} else {if (loginEmail. search (/^ \ w + (-\ w +) | (\. \ w +) * \ @ [A-Za-z0-9] + ((\. |-) [A-Za-z0-9] + )*\. [A-Za-z0-9] + $ /)! =-1) {$ warning. empty (); return true;} else {$ export warning. empty (). text ("enter the correct email format ");}}});
How to write code for email verification in js Form Verification
1,
Else if (document. getElementById ("email "). value. replace (// g ,""). search (/^ \ w + (-\ w +) | (\. \ w +) * \ @ [A-Za-z0-9] + ((\. |-) [A-Za-z0-9] + )*\. [A-Za-z0-9] + $/) =-1)
{
If (document. all)
{
Alert ('Enter the correct Email address ');
Event. returnValue = false;
}
Else
{
Alert ('Enter the correct Email address ');
Event. preventDefault ();
}
}
2,
3,
4,
Js Form Verification
// Check the mailbox function isEmail (str) {var reg =/^ ([a-zA-Z0-9 _-]) + @ ([a-zA-Z0-9 _-]) + ((\. [a-zA-Z0-9 _-] {2, 3}) {1, 2}) $/; return reg. test (str );}
// Password:
<Html>