bug宝典之bootstrap中bootstrapValidator 1

使用bootstrap和bootstrapvalidator的时候,提示这样的错误
Uncaught RangeError: Maximum call stack size exceeded
将异常展开,如下图所示,在bootstrapValidator.js中403
异常展开
跟踪发现当group为.form-group时,提示报错
group调试
页面代码如下:

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<%@ include file="/WEB-INF/views/include/meta.jsp"%>
	<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
	<%@ include file="/WEB-INF/views/include/common-css.jsp"%>
</head>
<body class="bg-login">
	<div class="container login-header">
		<div class="login-logo">
			<div class="login-logo-zh">XXXX系统</div>
			<div class="login-logo-en">XXXX XI TONG</div>
		</div>
	</div>
    <div class="middle-box loginscreen bg-white" >
        <div class="login-top"></div>
        <div class="login-title text-center">
        	<h1>用户登录</h1>
        </div>
        <form role="form" class="form-horizontal" id="loginForm">
            <div class="padding has-feedback">
                <input type="text" class="form-control text-center" required id="username" name="username" placeholder="请输入用户名"/>
            </div>
            <div class="padding-horizontal padding-bottom has-feedback">
                <input type="password" class="form-control text-center" required autocomplete="off" id="password" name="password" placeholder="请输入密   码"/>
            </div>
            <div class="row padding-horizontal padding-bottom has-feedback">
                <div class="col-sm-6">
                    <input type="text" class="form-control text-center" id="captcha" name="captcha" placeholder="验证码" autocomplete="off">
                </div>
                <div class="col-sm-6">
                    <img alt="验证码" class="img-responsive" src="${ctx}/resources/images/kaptcha.jpg" title="点击更换" id="img_captcha" style="height:34px;" />
                </div>
            </div>
            <div class="padding-horizontal padding-bottom">
                <button type="button" class="btn btn-primary full-width" id="btnSubmit">登录</button>
            </div>
        </form>
    </div>
</body>
<%@ include file="/WEB-INF/views/include/common-js.jsp"%>
	<!-- 加载js文件 -->
	<script>
	require(['login']);
	</script>

</html>

我的form中确实没有用form-group,看来bootstrapValidator的form校验此css样式是必须的。更正如下:

<form role="form" class="padding-horizontal " id="loginForm">
            <div class="form-group has-feedback">
                <input type="text" class="form-control text-center" required id="username" name="username" placeholder="请输入用户名"/>
            </div>
            <div class="form-group has-feedback">
                <input type="password" class="form-control text-center" required autocomplete="off" id="password" name="password" placeholder="请输入密   码"/>
            </div>
            <div class="form-group has-feedback row ">
                <div class="col-sm-6">
                    <input type="text" class="form-control text-center" id="captcha" name="captcha" placeholder="验证码" autocomplete="off">
                </div>
                <div class="col-sm-6">
                    <img alt="验证码" class="img-responsive" src="${ctx}/resources/images/kaptcha.jpg" title="点击更换" id="img_captcha" style="height:34px;" />
                </div>
            </div>
            <div class="padding-bottom">
                <button type="button" class="btn btn-primary full-width" id="btnSubmit">登录</button>
            </div>
        </form>
  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

warrah

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值