<!--
function namecheckdate(){
var name=document.myform.name,i,length=myform.name.value.length;
if(name.value==null){
alert("用户名不能为空");
name.focus();return false;
}
for (i=0;i<=length-1;i++){
if(name.value.charAt(i)>'a'&&
   name.value.charAt(i)<'z'||(name.value.charAt(i)>'A'&&
   name.value.charAt(i)<'Z'){}else
   {alert('用户名不合法');name.focus();name.select();}
   }
   }
function checkdata(){
   var age=document,myform.age;
   if(age.value==null){
              alert('年龄不能为空');age.focus();return false;
                    }
   if(!(age.value>0 &&age.value<100)){alert
   ("你不是顽童就是寿星");age.focus();return false;
   }
   if(myform.password.value.length<4||myform.password.value.length>10{alert('密码在4到10之间');
   myform.password.value!=myform.password.value){alert
   ('密码不一致');return false;
   }
   if(myform.jieshao.value==null){alert
   ('个人介绍不能为空');myform.jieshao.focus();return false;
   }
   }//-->
   </script> 

解决方案 »

  1.   

    PHP代码是没有问题的,有错误提示?
      

  2.   

    你的PHP代码在哪里?我貌似只看到了js的代码
      

  3.   

    很奇怪啊,PHP代码在哪里呢???
      

  4.   

    你这代码 只是用户输入时的验证  PHP代码都没有填出来  神仙都救不了你
      

  5.   

    {alert('用户名不合法');name.focus();name.select();}
    好像没有select这个方法吧
      

  6.   

    这是  JS  代码.非  PHP  .....可以用 FireBug  来调试一下的.....
      

  7.   

    只看到JS。
    不过JS验证写成这样,你是英雄!
    换个浏览器,你的代码就OVER了