解决方案 »

  1.   

    <div class="container">
    <div class="theme-poptit">
    <h1 style="text-align: center;">注册用户</h1>
    </div>
    <!-- theme-poptit -->
    <div class="col-md-5" style="margin-top: 10%">
    <form class="theme-signin" name="boxform" 
    method="post" onsubmit="return BoxCheck(this)">
    <ol>
    <li><h3>企业用户注册</h3></li>
    <li><h4>机身码</h4> <input class="ipt" type="text" name="boxid"
    value="" size="18" /></li>
    <li><h4>企业账号</h4> <input class="ipt" type="text"
    name="groupid" value="" size="18" /></li>
    <li><h4>企业密码</h4> <input class="ipt" type="password"
    name="grouppass" value="" size="18" /></li>
    <li><h4>确认密码</h4> <input class="ipt" type="password"
    name="regppass" value="" size="18" /></li>
    <li><input class="btn btn-block btn-primary"
    style="width: 180px;" type="submit" value="激活注册 " /></li>
    </ol>
    </form>
    </div>
    <div class="col-md-7" style="margin-top: 10%">
    <form class="theme-signin" name="ptform" action="regCheck.php"
    method="post" onSubmit="return InputCheck(this)">
    <ol>
    <li><h3>普通用户注册</h3></li>
    <li><h4>用户名</h4> <input class="ipt" type="text"
    name="username" value="" size="18" /></li>
    <li><h4>密码</h4> <input class="ipt" type="password"
    name="password" value="" size="18" /></li>
    <li><h4>确认密码</h4> <input class="ipt" type="password"
    name="repass" value="" size="18" /></li>
    <li><input class="btn btn-primary btn-block "
    style="width: 180px;" type="submit" value="注册 " /></li>
    </ol>
    </form>
    </div>
    </div>
      

  2.   

    表单没问题。是不是 BoxCheck()和InputCheck()函数的问题。
      

  3.   

    我贴上来看看
    function BoxCheck(boxform) {
    if (boxform.boxid.value == "") 
    {
    alert("机身码不能为空!!");
    boxform.boxid.focus();
    return (false);
    }
    if (boxform.groupid.value == "") 
    {
    alert("用户名不能为空!");
    boxform.groupid.focus();
    return (false);
    }
    if (boxform.groupid.value。length >20 )
    {
    alert("用户名长度超限");
    boxform.groupid.focus();
    return (false);
    } if (groupform.grouppass.value == "") 
    {
    alert("用户密码不符合规范!");
    boxform.grouppass.focus();
    return (false);
    }

    if (groupform.grouppass.value > 40) 
    {
    alert("用户密码长度超限");
    boxform.grouppass.focus();
    return (false);
    } if (boxform.regppass.value != boxform.grouppass.value) 
    {
    alert("两次终端密码不一致!");
    boxform.regppass.focus();
    return (false);
    }
    } function InputCheck(ptform) 
    {
    if (ptform.username.value == "") 
    {
    alert("用户名不能为空!");
    ptform.username.focus();
    return (false);
    }

    if (ptform.username.value.length > 20) {
    alert("用户名长度超限!");

    ptform.username.focus();
    return (false);
    }

    if (ptform.password.value =="") 
    {
    alert("用户密码不能为空!");
    ptform.password.focus();
    return (false);
    } if (ptform.password.value.length > 40) 
    {
    alert("用户密码长度超限!");
    ptform.password.focus();
    return (false);
    }

    if (ptform.repass.value != ptform.password.value) 
    {
    alert("两次密码不一致!");
    ptform.repass.focus();
    return (false);
    }
    }
    再次描述 Inputcheck可以实现   boxcheck无法实现
      

  4.   

    groupform是什么?你的变量不是boxform么?
      

  5.   

    // if (boxform.groupid.value。length >20 )
     if (boxform.groupid.value.length >20 )
     {
     alert("用户名长度超限");
    boxform.groupid.focus();
     return (false);
     }// if (groupform.grouppass.value == "") 
     if (boxform.grouppass.value == "") 
     {
     alert("用户密码不符合规范!");
    boxform.grouppass.focus();
     return (false);
     }// if (groupform.grouppass.value > 40) 
     if (boxform.grouppass.value.length > 40) 
     {
     alert("用户密码长度超限");
    boxform.grouppass.focus();
     return (false);
     }
      

  6.   

    这些改完也是没用 ,我刚刚尝试了将inputcheck注释掉,发现boxcheck是无效的,然后将boxcheck里面内容注释后alert()是有反应的,真是心塞的不行,到时哪里出问题了。