This article is a simple JavaScript detection username and password is correct function Oh, if you are JS beginners can look at this code OH.
<script language= ' JavaScript ' >
function XGJC (YHM,MM,XMM,QM)
{
if (yhm== "")
{
Alert (' username cannot be empty! ');
Document.de.yhm.focus ();
return false;
}
if (MM!=XMM)
{
Alert (' Two input passwords inconsistent! ');
Document.de.mm.focus ();
return false;
}
if (qm.length>=49)
{
Alert (' Signed too long! ');
Document.de.qm.focus ();
return false;
}
}
function ZCJC (YHM,MM,XMM,QM)
{
if (yhm== "")
{
Alert (' username cannot be empty! ');
Document.zc.yhm.focus ();
return false;
}
if (Yhm.indexof ("") >=0 | | Yhm.indexof ("<") >=0 | | Yhm.indexof (">") >=0 | | Yhm.indexof (".") >=0)
{
Alert (' username cannot have garbled! ');
Document.zc.yhm.focus ();
return false;
}
if (mm== "")
{
Alert (' Password cannot be empty! ');
Document.zc.mm.focus ();
return false;
}
if (MM!=XMM)
{
Alert (' Two input passwords inconsistent! ');
Document.zc.mm.focus ();
return false;
}
if (Mm.indexof ("") >=0 | | Mm.indexof ("<") >=0 | | Mm.indexof (">") >=0 | | Mm.indexof (".") >=0)
{
Alert (' Can't have garbled! ');
Document.zc.mm.focus ();
return false;
}
if (qm.length>=49)
{
Alert (' Signed too long! ');
Document.zc.qm.focus ();
return false;
}
}
</script>
Here is the HTML code
<form name= "Zc" action= "TB_ZC.ASP?CZ=ZCCG" method= "POST" >
<div align= "left" >
<p> Username:
<input name= "YHM" type= "text" size= ">
*<br>
Password:
<input name= "mm" type= "password" size= ">
"
*<br>
Password:
<input name= "qxmm" type= "password" size= ">
"
*<br>
Personality Signature:
<input type= "text" Name= "QM" size= "" maxlength= ">
"
<br>
e-mail:
<input name= "Lxfs" type= "text" size= "M" maxlength= ">
"
</p>
<p align= "center" >
<input type= "Submit" Name= "ZC" value= "registered" onclick= "Return ZCJC (Yhm.value,mm.value,qxmm.value,qm.valu e); >
</p>
</div>
</form>