<script language="javascript"> 
function cheakno() 

  var no = document.form1.userjc.options[document.form1.userjc.selectedIndex].value; 
  return (no == "06");
} function frmcheak() 
{
   if(cheakno()){
       if(document.form1.userno.value.length != 9){
          alert('学号输入不正确!');
                  document.form1.userno.focus();
          return false;
       }
   }
   else{
       if(document.form1.userno.value.length != 11 || document.form1.userno.value.length != 13){
          alert('学号输入不正确!');
          document.form1.userno.focus();
          return false;
       }
   }  if(document.form1.username.value == "") 
  { alert('姓名输入不正确!'); 
    document.form1.username.focus(); 
    return false; 
  }
  if (document.form1.userid.value.length != 18)  
  {  alert('身份证号输入不正确!');  
     document.form1.userid.focus(); 
     return false; 
  }
  if (document.form1.userxi.value == "")  
  {  alert('请填写所在系!');  
     document.form1.userxi.focus(); 
     return false; 
  }
  if (document.form1.userzy.value == "")  
  {  alert('请填写您的专业!');  
     document.form1.userzy.focus(); 
     return false; 
  }
  if (document.form1.userroom.value == "")  
  {  alert('请填写您的宿舍号!');  
     document.form1.userroom.focus(); 
     return false; 
  }
  document.form1.submit(); 

</script>