We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在与Bootstrap 3.0.0 RC2集成时,验证信息显示位置如下图所示:
javascript:
$(function() { $('#registerForm').validator({ theme : 'simple_right', fields : { 'email' : 'required;email;remote[check/email]', 'username' : 'required;username;remote[check/username]', 'password' : 'required;password' } }); });
html:
<div class="container"> <form id="registerForm" class="form-horizontal" action="" method="POST"> <fieldset> <legend>注册</legend> <div class="form-group"> <label for="inputEmail" class="col-lg-2 control-label">电子邮箱</label> <div class="col-lg-4"> <input name="email" type="text" class="form-control" id="inputEmail" placeholder="电子邮箱"> </div> </div> <div class="form-group"> <label for="inputUsername" class="col-lg-2 control-label">用户名</label> <div class="col-lg-4"> <input name="username" type="text" class="form-control" id="inputUsername" placeholder="用户名"> </div> </div> <div class="form-group"> <label for="inputPassword" class="col-lg-2 control-label">密码</label> <div class="col-lg-4"> <input name="password" type="password" class="form-control" id="inputPassword" placeholder="密码"> </div> </div> <div class="form-group"> <div class="col-lg-offset-2 col-lg-10"> <button type="submit" class="btn btn-primary">注册</button> </div> </div> </fieldset> </form> </div>
The text was updated successfully, but these errors were encountered:
@shelltea 原因是因为Bootstrap 将input设置了display:block;,就没法在右侧显示消息了 。 但据我的考察,设置inline-block就可以了,CSS代码如下:
display:block;
inline-block
.form-control { display: inline-block; *display: inline; *zoom: 1; }
修正后的演示: http://jsbin.com/ofetak/11
Sorry, something went wrong.
@niceue 使用你的方法,确实解决了此问题,但是这样每次升级Bootstrap都需要修改这行代码,并且有可能对其他地方产生影响。能否提供一个更好的方式兼容Bootstrap?
@shelltea 还一种办法是在jquery.validator.css中添加补丁,代码如下:
.n-validator input, .n-validator select, .n-validator textarea { display: inline-block; *display: inline; *zoom: 1; }
不过,我要再考察一下,如果这个样式没问题(不会对Bootstrap产生影响),将在下个版本中添加进去。
@shelltea 顺便问下:Bootstrap 3不是不支持IE6/7吗?你们的项目蛮先进的嘛
@niceue 在实际的项目中用过一次Bootstrap 2,因为项目是面向特定的用户,所以我们以安全性、性能等因素说服了他们使用Chrome。
niceue
No branches or pull requests
在与Bootstrap 3.0.0 RC2集成时,验证信息显示位置如下图所示:
javascript:
html:
The text was updated successfully, but these errors were encountered: