求助- -在线等 表单 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <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> 表单没问题。是不是 BoxCheck()和InputCheck()函数的问题。 我贴上来看看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无法实现 groupform是什么?你的变量不是boxform么? // 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); } 这些改完也是没用 ,我刚刚尝试了将inputcheck注释掉,发现boxcheck是无效的,然后将boxcheck里面内容注释后alert()是有反应的,真是心塞的不行,到时哪里出问题了。 jquery ajax 参数问题 请教一个关于jquery的问题, Ext inputType 问题 我的菜单 在IE下正常运行 在火狐下就不可以了? javascript函数的意思? 发现一个 function arguments 非常有趣的问题(散分) 网页里添加图片问题 大家好~~关于回调或者setTimeout的使用 请问如何判断输入的字符不是~!@#$%^^&*()这些特殊字符,谢谢!! 怎样把二个文本框的数据相减? 关于jsp页面根据判断弹出小提示框的问题 window.print()直接打印,不弹出设置打印参数的对话框
<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>
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无法实现
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);
}