我有验证2个字段是国家代码和实际的手机号码。我附上了截图。当给出正确的国家代码并且当时给出无效的移动号码时,用于国家代码和交叉字形的正确的嘀嗒字符相互重叠。我需要通过使用css或js删除国家代码的glyphicon。任何帮助将不胜感激。Bootstrap验证:2个glyphicons重叠
0
A
回答
0
我找到了答案。我通过使用jQuery来完成它。
我的实际HTML是如下,
<div class="input-group">
<div class="input-group-addon">+</div>
<input type="tel" maxlength="3" class="form-control pull-left" id="CountryCode" name="CountryCode" placeholder="Code">
<input data-bv-field="Mobile" type="text" id="Mobile" name="Mobile" class="form-control">
</div>
引导正确和错误的,因为下面的HTML下面创建glyphicons,以下
<i class="form-control-feedback bv-no-label bv-icon-input-group glyphicon glyphicon-ok" data-bv-icon-for="CountryCode" style=""></i>
<i class="form-control-feedback bv-no-label bv-icon-input-group glyphicon glyphicon-ok" data-bv-icon-for="Mobile" style=""></i>
所以我加入了一行代码以删除正确的,国家代码字段的错误字形,
$("#CountryCode").parent().next().removeClass('glyphicon-ok glyphicon-remove');
0
如果你正在使用jQuery:
假设你有
<div class="container">
<div class="form">
form content...
</div>
</div>
你会打电话:
$('.container form .glyphicon').each(function(i){ // your target input id or class should be placed between 'form' and '.glyphicon' eg: $('.container form input[name=state_code] .glyphicon')
if (i!=0) $(this).remove();
});
这样你摆脱额外的Xes出现在你不需要的时候。
相关问题
- 1. Twitter Bootstrap Glyphicons
- 2. Bootstrap中的GLYPHICONS 2.3.2
- 3. php中的bootstrap glyphicons
- 4. jQuery验证错误消息放大glyphicons
- 5. Bootstrap中缺少glyphicons 2.3.2
- 6. JavaScript Bootstrap验证
- 7. Bootstrap验证
- 8. 使2个图像重叠
- 9. 验证价格范围重叠
- 10. 验证时间戳与PHP重叠
- 11. 如何在java中验证重叠否
- 12. Kohana输入和验证库 - 重叠?
- 13. 堆叠时Bootstrap网格系统重叠
- 14. Bootstrap验证器resetForm
- 15. Bootstrap与重叠图像
- 16. Bootstrap + Wordpress重叠问题
- 17. Bootstrap输入边框重叠
- 18. bootstrap容器相互重叠
- 19. Bootstrap验证器验证号码范围
- 20. Bootstrap验证器 - 成功验证通知
- 21. jquery验证2个电台
- 22. jQuery验证2个字段
- 23. 如何修复Bootstrap中的重叠输入2
- 24. 404 Not Found Glyphicons Bootstrap解决方法
- 25. bootstrap-sass 3.3.3显示为矩形的glyphicons
- 26. “glyphicon-th”代表Bootstrap Glyphicons代表什么?
- 27. Bootstrap glyphicons不能在java webapp工作
- 28. glyphicons bootstrap图标不与textarea对齐
- 29. 如何使用Jade标记Bootstrap glyphicons?
- 30. Bootstrap 3.3.7 glyphicons不适用于jQueryUi 1.12
添加产生问题的代码 – neophyte
@neophyte我在下面添加了代码。我通过使用jQuery来处理它。 –