SoFunction
Updated on 2025-02-28

JavaScript simple verification code (user name, password, email)


<script language="javascript">
function IsDigit(cCheck)
{
return (('0'<=cCheck) && (cCheck<='9'));
}
function IsAlpha(cCheck)
{
return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z')))
}
function IsaNull(cCheck)
{
return(cCheck != " ")
}
function checkform()
{
id = document.;
if (id == "")
{
alert("Please enter the registration name");
document.();
return false;
}
for (nIndex=0; nIndex<; nIndex++)
{
cCheck = (nIndex);
if (!(IsDigit(cCheck) || IsAlpha(cCheck) || cCheck=='-' || cCheck=='_' || cCheck=='.'))
{
alert("Usernames can only use letters, numbers, and -, _ and., and cannot use Chinese");
document.();
return false;
}
}
chineseid = document.;
if (chineseid == "")
{
alert("Please enter the Chinese nickname");
document.();
return false;
}
password = document.;
if (password == "")
{
alert("Please enter the login password");
document.();
return false;
}
password1 = document.sform1.;
if (password>password1)
{
alert("Repeat password is not the same as login password");
document.();
document.sform1.();
return false;
}
if (password<password1)
{
alert("Repeat password is not the same as login password");
document.();
document.sform1.();
return false;
}
if (document. == "")
{
alert("Please enter your E-MAIL address");
document.();
return false;
}
email=document.;
emailerr=0
for (i=0; i<; i++)
{
if (((i) == "@") & ( > 5))
{
emailerr=emailerr+1
}
}
if (emailerr != 1)
{
alert("Please enter the correct E-MAIL address");
document.();
return false;
}
if (document.=="")
{
alert("Password prompts problem cannot be empty");
document.();
return false;
}
if (document.=="")
{
alert("Your password prompts the answer to the question cannot be empty");
document.();
return false;
}
return true;
}
</script>