帝王谷资源网 Design By www.wdxyy.com

解决type=file 文件修改表单 名称不能正常回显的问题

easyui 框架下   代码如下:

css:

.file_box{
float: right;
width: 1035px;
border: 1px solid #999;
height: 32px;
line-height: 35px;
padding-left: 10px;
margin-right: 25px;
}
.file{
float: right;
outline: none;
border:none;
background: #67BEF4;
border-radius: 4px;
padding: 4px 12px;
cursor:pointer;
color: #fff;
font-size:18px;
line-height: 20px;
vertical-align: middle;
margin: 2px;
}

html 页面:

<div class="file_box">
<button type="button" class="file" id="select_file" onclick="file1.click();" > 选择附件</button>
<input type="file" id="file1" name="PXXA_APPENDIX" style="width:250px;display: none;" onchange="setfile_tmp()";>
<input type="text" id="file2" readonly="readonly" th:value="${map.PXXA_APPENDIX}" onclick="file1.click(); ">
</div>

js脚本:

function setfile_tmp(){

var file11 = $("#file1")[0].value;
var arrays1 = file11.split("\\");
var name1 = arrays1[arrays1.length-1];
name1=name1.toLowerCase();
$("#file2")[0].value=name1;
}

总结

标签:
type,file,文件修改表单

帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com