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 文件修改表单 名称不能正常回显的问题的文章就介绍到这了,更多相关type=file内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!

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