SoFunction
Updated on 2025-04-03

Simple example of the javascript user registration prompt effect


<script type="text/javascript">
var $= function(id)
{
 return (id);
}
function check()
{
 if( $('username').value == "" )
 {
$('eusername').innerHTML='<p class="login_jjB"> Please enter the registered user name!</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"> The password entered twice is inconsistent!</p>';
  return false;  
 }
 else
 {
  $('epasswd2').innerHTML='';
 }
 if( $('email').value == "" )
 {
$('email').innerHTML='<p class="login_jjB"> Email address!</p>';
  return false; 
 }
 else
 {
  $('eemail').innerHTML='';
 }
 if( $('vaild').value == "" )
 {
$('evaild').innerHTML='<p class="login_jjB"> Please enter the verification code on the right!</p>';
  return false; 
 }
 else
 {
  $('evaild').innerHTML='';
 } 
}
</script>
<form name="registerform" method="POST" action="">
<input type="hidden" name="action" value="register">
  <input type="hidden" name="user_type" value="1">
<ul><li><h1>Username:</h1>
    <div class="login_jjA">
    <span style="display:none;">
    <select name="cityid" style="width:100px;"    onblur="changelocation([].value)">
<option value="">--Company not limited-</option>
<option value="2">--Hangzhou Sheyi Real Estate Agency Co., Ltd.--</option>
         </select>
              <select  name="cityareaid"  style="width:100px;"  >
<option value="0">--No store limit-</option>
              </select>
    </span>
    <input name="username"  type="text" class="jinru_in" value=""   onblur="check();"  onclick="check();" /></div>
    <div  ></div>
 </li>
<li><h1>Password:</h1>
 <div class="login_jjA"><input name="passwd" type="password" class="jinru_in"  onblur="check();"  onclick="check();"  /></div>
    <div  ></div>
 </li>
<li><h1>Confirm password:</h1>
 <div class="login_jjA"><input name="passwd2" type="password" class="jinru_in"  onblur="check();"  onclick="check();"  /></div>
    <div  ></div>
 </li>
<li><h1>Email address:</h1>
 <div class="login_jjA"><input name="email" type="text" size="30"   value=""  class="jinru_in"  onblur="check();"  onclick="check();"  /></div>
    <div ></div>
 </li>
<li><h1>Verification code:</h1>
 <div class="login_jjA">
    <input name="vaild" type="text" class="inlen"    onblur="check();"  onclick="check();" size="5"  /><img  src="/" /></div>
    <div  ></div>
 </li>
 <li style="height:35px;"><h1> </h1>
 <div class="jinruD"><input value=" " type="submit"  onclick="javascript:return check();"  class="login_jj_btn"/></div>
 </li>
 </ul>
  </form>