Registration Information Verification (small special effects) + ajax callback detection Username

Source: Internet
Author: User

<Script type = "text/javascript" src = "http://www.cnblogs.com/js/jquery.js"> </script>
<Script type = "text/javascript">
Function getRealLength (str ){
Return str. replace (/[^ \ x00-\ xff]/g, '**'). length;
}
$ (Document). ready (function (){
$ ("# Ctl00_ContentPlaceHolder1_login_name"). click (function (){
$ ("# Loginid_info"). removeClass ("note") ;}). blur (function (){
If ($ ("# ctl00_ContentPlaceHolder1_login_name"). val (). length <5) | ($ ("# ctl00_ContentPlaceHolder1_login_name"). val (). length> 20 ))
{$ ("# Loginid_info" ).html ("<span style = \" color: red \ "> the input length is not between 4-20 characters </span> ");

}
Else
{
$ ("# Loginid_info" ).html ("username detection .....");
$. Ajax ({
"Type": "get ",
"Url": "ajax. aspx? Userid = "+ $ (" # ctl00_ContentPlaceHolder1_login_name "). val (),
"Success": function (data ){
// Alert (data );
// If (data = "0 ")
//{
$ ("# Loginid_info" pai.html (data );
//}
// Else if (Data = "1 ")
//{
// $ ("# Loginid_info" ).html ("<span style = \" color: Red \ "> This member already exists in the Database. Please enter it again! </Span> ");
//}
},
"Error": function (){
$ ("# Loginid_info" pai.html (data );
}

});

}
})
});
$ (Document). Ready (function (){
$ ("# Ctl00_contentplaceholder1_password"). Click (function (){
$ ("# Password_info"). removeclass ("NOTE") ;}). Blur (function (){
If ($ ("# ctl00_contentplaceholder1_password"). Val (). length <6) | ($ ("# ctl00_contentplaceholder1_password"). Val (). length> 20 ))
{
$ ("# Password_info" ).html ("<span style = \" color: red \ "> the input length is not between 6 and 20 </span> ");
}
Else
{

$ ("# Password_info" pai.html ("");
}
})
});

$ (Document). ready (function (){
$ ("# Ctl00_ContentPlaceHolder1_confirm_password"). click (function (){
$ ("# Confirm_password_info"). removeClass ("note") ;}). blur (function (){
If ($ ("# ctl00_contentplaceholder=confirm_password"). val ()! = $ ("# Ctl00_ContentPlaceHolder1_password"). val ())
{$ ("# Confirm_password_info" ).html ("<span style = \" color: red \ "> the two passwords are inconsistent! </Span> ");
}
Else
{
$ ("# Confirm_password_info" ).html ("");
}
})
});
$ (Document). ready (function (){
$ ("# Ctl00_contentplaceholderdeletemail"). click (function (){
$ ("# Email_info"). removeClass ("note") ;}). blur (function (){
Var regemail =/^ ([_ a-zA-Z0-9-] {2,}) + @ ([_ a-zA-Z0-9-] {2,}) + \.) + [a-zA-z] {2, 3} $ /;
If (! Regemail. test ($ ("# ctl00_contentplaceholderpolictemail"). val ()))
{
$ ("# Email_info" ).html ("<span style = \" color: red \ "> Incorrect email format! </Span> ");
}
Else
{
$ ("# Email_info" ).html ("");
}
})
});

$ (Document). ready (function (){
$ ("# Ctl00_ContentPlaceHolder1_tMemberTelephone"). click (function (){
$ ("# Mobile_info1"). removeClass ("note") ;}). blur (function (){
If ($ ("# ctl00_contentplaceholder=tmembertelephone"). val () = "")
{$ ("# Mobile_info1" ).html ("<span style = \" color: red \ "> the input cannot be blank! </Span> ");
}
Else
{
$ ("# Mobile_info1" ).html ("");
}
})
});
</SCRIPT>
<! -- // Register start -->
<Div id = "register">
<Div class = "rightinfo">
<Div class = "title">
<Ul>
<Li> set your account information </LI>
</Ul>
</Div>
<Div class = "content">
<Div id = "name">
<Div id = "loginid_info_check" class = "text"> member logon name </div>
<Div class = "redstar"> * </div>
</Div>
<Div class = "input">
<Input type = "text" class = "note" id = "login_name" runat = "server"/>
</Div>
<Div id = "loginid_info" class = "note">
It consists of 4-20 letters or numbers. Chinese characters are not supported. It cannot start with a number and cannot be modified after registration.
</Div>
</Div>
<Div class = "content">
<Div id = "name">
<Div id = "password_info_check" class = "text"> & nbsp; password </div>
<Div class = "redstar"> * </div>
</Div>
<Div class = "input">
<Input type = "password" id = "password" class = "note" runat = "server"/>
</Div>
<Div id = "password_info" class = "note">
It consists of 6-20 letters (case sensitive) or numbers.
</Div>
</Div>
<Div class = "content">
<Div id = "name">
<Div id = "confirm_password_info_check" class = "text"> & nbsp; repeated Password Input </div>
<Div class = "redstar"> * </div>
</Div>
<Div class = "input">
<Input type = "password" id = "confirm_password" class = "NOTE" value = "" runat = "server"/>
</Div>
<Div id = "confirm_password_info" class = "NOTE"> enter the password you entered. </Div>
</Div>
</Div>
<Div class = "title">
<Ul>
<Li> name and contact information </LI>
</Ul>
</Div>
<Div class = "content">
<Div id = "name">
<Div id = "first_name_info_check" class = "text"> & nbsp; real name </div>
<Div class = "redstar"> * </div>
</Div>
<Div class = "input">
<Input id = "tRealName" class = "note" type = "text" value = "" runat = "server"/>
</Div>
<Div id = "first_name_info" class = "note"> & nbsp; </div>
</Div>
<Div class = "content">
<Div id = "name">
<Div id = "title_info_check" class = "text"> & nbsp; Gender </div>
<Div class = "redstar"> * </div>
</Div>
<Div id = "memberTitle" class = "input">
& Nbsp; <asp: RadioButtonList ID = "tSex" runat = "server" RepeatDirection = "Horizontal"
Repeatlayout = "flow">
<Asp: listitem selected = "true" value = "0"> male </ASP: listitem>
<Asp: listitem value = "1"> female </ASP: listitem>
</ASP: radiobuttonlist> </div>
<Div id = "name" class = "NOTE"> & nbsp; </div>
</Div>
<Div class = "content">
<Div id = "name">
<Div class = "text" id = "job_title_info_check"> & nbsp; occupation </div>
<Div class = "redstar"> * </div>
</Div>
<Div class = "input">
<Asp: DropDownList ID = "ddlMemberJob" runat = "server" Width = "90%">
<Asp: ListItem Text = "Financial Industry"> </asp: ListItem>
<Asp: ListItem Text = "Computer Industry"> </asp: ListItem>
<Asp: ListItem Text = "business"> </asp: ListItem>
<Asp: listitem text = "service industry"> </ASP: listitem>
<Asp: listitem text = "engineer"> </ASP: listitem>
<Asp: listitem text = "supervisor and Manager"> </ASP: listitem>
<Asp: listitem text = "Manufacturing"> </ASP: listitem>
<Asp: listitem text = "sales/advertisement/market"> </ASP: listitem>
<Asp: listitem text = "other industries"> </ASP: listitem>
</Asp: DropDownList>
</Div>
<Div class = "note" id = "job_title_info"> & nbsp; </div>
</Div>
<Div class = "content">
<Div id = "name">
<Div class = "text" id = "email_info_check"> & nbsp; email </div>
<Div class = "redstar"> * </div>
</Div>
<Div class = "input"> <input maxlength = "50" id = "temail" type = "text" value = "" runat = "server"/> </div>
<Div class = "NOTE" id = "email_info"> enter your email address </div>
</Div>
<Div class = "content">
<Div id = "name">
<Div class = "text" id = "phone_info_check"> & nbsp; landline phone </div>
<Div class = "Redstar"> * </div>
</Div>
<Div class = "inputwidth" style = "width: 371px">
<Div class = "input2">
& Nbsp;
<Input id = "tMemberTelephone" value = "" type = "text" maxlength = "16" runat = "server"/> </div>
</Div>
</Div>
<Div class = "content" id = "mobile_info1">


</Div>
<Div class = "content" id = "tele">
<Div id = "name">
<Div class = "text" id = "mobile_info_check"> mobile phone </div>
<Div class = "redstar"> & nbsp; </div>
</Div>
<Div class = "input">
<Input id = "tMemberMobile" value = "" type = "text" maxlength = "16" runat = "server"/>
</Div>
<Div class = "note" id = "mobile_info"> & nbsp; </div>
</Div>

<Div id = "operation1">
<Input type = "submit" name = "Submit" value = "submit Registration Information" class = "button" id = "Submit1" onclick = "return CheckForms2 (); "onserverclick =" submitemailserverclick "runat =" server "/>
</Div>
</Div>

Related Article

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.