Common registration process Judgment (username, password, e-mail)

Source: Internet
Author: User
<script language= "JavaScript" >
function Check ()
{
if (document. Form1.user.value = "")
{
Alert ("Please fill in your username!") ");
Document. Form1.user.focus ();
return (false);
}
var filter=/^s*[. a-za-z0-9_-]{5,15}s*$/;
If!filter.test (document. Form1.user.value)) {
Alert ("User name is not filled out correctly, please fill in again!") Available character identifier (A-Z-A-Z 0-9 _-.) No less than 5 characters in length, no more than 15 characters, be careful not to use spaces. ");
Document. Form1.user.focus ();
Document. Form1.user.select ();
return (false);
}
if (document. Form1.pass.value = "")
{
Alert ("Please fill in your password!") ");
Document. Form1.pass.focus ();
return (false);
}
if (document. form1.confirmpassword.value== "") {
Alert ("Please enter your confirmation password!") ");
Document. Form1.confirmPassword.focus ();
return (false);
}
var filter=/^s*[. a-za-z0-9_-]{5,15}s*$/;
If!filter.test (document. Form1.pass.value)) {
Alert ("Password is not filled in correctly, please fill in again!") Available character identifier (A-Z-A-Z 0-9 _-.) No less than 5 characters in length, no more than 15 characters, be careful not to use spaces. ");
Document. Form1.pass.focus ();
Document. Form1.pass.select ();
return (false);
}
if (document. Form1.pass.value!=document. Form1.confirmPassword.value) {
Alert ("Two completed passwords inconsistent, please fill in again!") ");
Document. Form1.pass.focus ();
Document. Form1.pass.select ();
return (false);
}
if (document. Form1.question.value = "")
{
Alert ("Please enter a password question!") ");
Document. Form1.question.focus ();
return (false);
}
if (document. Form1.answer.value = "")
{
Alert (Please enter the answer to the password prompt!) ");
Document. Form1.answer.focus ();
return (false);
}
if (document. Form1.email.value = "")
{
Alert ("Please enter your email address!") ");
Document. Form1.email.focus ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.