表单input项使用label同时引用Bootstrap库导致input点击效果区增大问题
来源:互联网 发布:导弹拦截 CSDN C语言 编辑:程序博客网 时间:2024/06/05 17:00
<div class="form-group col-lg-12"><label class="control-label col-lg-1 text-right"></label> <label class="control-label col-lg-2 text-right"> <input class="form-control-erbi col-lg-6" type="text" name="oldtitle[]" value="{$vo.title}" /> </label> <label class="control-label col-lg-2 text-right"> <input class="form-control-erbi col-lg-10" type="text" name="oldsec_title[]" value="{$vo.sec_title}" /> </label> <label class="control-label col-lg-5 text-left"> <span class="input-group file-caption-main col-lg-10" style="float: left;"> <div class="form-control file-caption kv-fileinput-caption" style="text-align:left;overflow: hidden;line-height: 23px;"> 尺寸必须是<span >600*400</span>,png格式 </div> <input style="display: none;width:0px;border:1px solid #ff99ff;" class="file-real" name="{$vo.id}oldwork_img" type="file" multiple="" /> <div class="input-group-btn file-btn"> <div class="btn btn-primary btn-file"> <i class="glyphicon glyphicon-folder-open"></i> <span class="hidden-xs">作品图片</span> </div> </div> </span> <span class="col-lg-2 erbi-form-right"> <a href="http://{$hostname}/{$vo.work_img}">点击查看</a> </span> </label><!--这里定义为label,如果点击label,会出发label里面隐藏的input事件,扩大input点击作用区域--> <label class="control-label col-lg-1"> <button type="button" class="btn btn-xs btn-danger del-img">删除</button> </label></div><!--这里定义为label,如果点击label,会出发label里面隐藏的input事件,扩大input点击作用区域-->注意:这里的上传文件,样式设置,修复了input type='file'的丑陋页面;
可以说bootstrap的label设定的js特性,也可以说是未设定好的bug;$(document).on('change','.file-real',function(){ $(this).prev().html($(this).val()); }).on('click','.file-btn',function(){ $(this).prev().click(); });
阅读全文
0 0
- 表单input项使用label同时引用Bootstrap库导致input点击效果区增大问题
- input+label使用
- 使用DIV+css中的label.input来编写注册表单
- bootstrap之input-group&label样式
- label包裹input,点击label,label响应两次
- 使用input + label替代placeholder
- 表单label与input对齐的方法
- 点击form表单的Input自动提交的问题
- CSS JQuery input+label实现placeholder效果
- Bootstrap File Input 的使用
- bootstrap-file-input使用心得
- bootstrap-input
- ios下点击label包含的input checkbox或radio无效问题
- FF中label中嵌套input问题
- bootstrap让label和input在一行里
- bootstrap让label和input在一行里
- Label标签结合input标签使用功能
- 使用input标签构成表单
- nginx-gzip压缩提升网站速度
- Recycleview设置间距
- golang中select和switch的区别
- 有序,无序,表单(章节二):
- 特征工程(一)
- 表单input项使用label同时引用Bootstrap库导致input点击效果区增大问题
- STM32的GPIO内部结构及相关寄存器
- CentOS6.4离线安装mysql5.6.22
- 策略设计模式
- 今天懂了2个道理
- 让VIM彻底告别乱码
- 【集训】jzoj 2017.7.8 noip模拟赛A 总结
- 背包问题
- jsp页面input的value中的值含英文双引号处理方法