JavaScript user Registration Prompt effect Simple example _javascript skill

Source: Internet
Author: User
Copy Code code as follows:

<script type= "Text/javascript" >
var $= function (ID)
{
return document.getElementById (ID);
}
function Check ()
{
if ($ (' username '). Value = = "")
{
$ (' Eusername '). innerhtml= ' <p class= ' LOGIN_JJB ' > Please enter the registered username!</p> ';
return false;
}
Else
{
$ (' Eusername '). Innerhtml= ';
}
if ($ (' passwd '). Value = = "")
{
$ (' epasswd '). innerhtml= ' <p class= ' LOGIN_JJB ' > enter password!</p> ';
return false;
}
Else
{
$ (' epasswd '). Innerhtml= ';
}
if ($ (' passwd2 '). Value!= $ (' passwd '). Value)
{
$ (' epasswd2 '). innerhtml= ' <p class= ' LOGIN_JJB ' > Two input passwords inconsistent!</p> ';
return false;
}
Else
{
$ (' epasswd2 '). Innerhtml= ';
}
if ($ (' email '). Value = = "")
{
$ (' Eemail '). innerhtml= ' <p class= ' LOGIN_JJB ' > E-mail address!</p> ';
return false;
}
Else
{
$ (' Eemail '). Innerhtml= ';
}
if ($ (' vaild '). Value = = "")
{
$ (' Evaild '). innerhtml= ' <p class= ' LOGIN_JJB ' > Please enter the right authentication code!</p> ';
return false;
}
Else
{
$ (' Evaild '). Innerhtml= ';
}
}
</script>
<form name= "Registerform" id= "Registerform" method= "POST" action= "" >
<input type= "hidden" name= "action" value= "register" >
<input type= "hidden" name= "User_type" value= "1" >
<ul><li><div class= "Login_jja" >
<span style= "Display:none;" >
<select name= "Cityid" id= "Cityid" style= "width:100px"; Onblur= "Changelocation (Document.registerform.cityid.options[document.registerform.cityid.selectedindex].value) ">
<option value= "" >--Company Limited--</option>
<option value= "2" >--Hangzhou apt Real Estate Agency Co., Ltd.--</option>
</select>
<select name= "Cityareaid" style= "width:100px;" Id= "Cityareaid" >
<option value= "0" >--Unlimited store--</option>
</select>
</span>
<input name= "username" id= "username" type= "text" class= "jinru_in" value= "" onblur= "Check ();" onclick= "Check ();"/></div>
<div id= "Eusername" ></div>
</li>
<li><div class= "Login_jja" ><input name= "passwd" type= "password" "id=" passwd "class=" jinru_in "onblur=" check (); "  onclick= "Check ();" /></div>
<div id= "EPASSWD" ></div>
</li>
<li><div class= "Login_jja" ><input name= "passwd2" type= "password" "id=" Passwd2 "class=" jinru_in "onblur=" check (); "  onclick= "Check ();" /></div>
<div id= "Epasswd2" ></div>
</li>
<li><div class= "Login_jja" ><input name= "Email" type= "text" size= "" id= "email" value= "" class= "jinru_in" onblur= "  "Check ();"  onclick= "Check ();" /></div>
<div id= "Eemail" ></div>
</li>
<li><div class= "Login_jja" >
<input name= "Vaild" type= "text" class= "Inlen" "id=" Vaild "onblur=" check (); " onclick= "Check ();" size= "5"/></div>
<div id= "Ever" ></div>
</li>
<li style= "height:35px;" ><div class= "Jinrud" ><input value= "type=" Submit "onclick=" Javascript:return check (); " class= "LOGIN_JJ_BTN"/></div>
</li>
</ul>
</form>

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.