修改文件上传按钮的样式

来源:互联网 发布:网络转串口调度器 编辑:程序博客网 时间:2024/05/22 04:39

1.在模态框里写文件的上传
2.修改input为file的样式
默认是“选择文件”,直接在后面显示文件的名字
解决:修改样式
方法如下:

  <form action="http://localhost:8080/GD/UploadAction_execute.action" method="post" enctype="multipart/form-data" name="uploadfile">  <input type="file" name="my" id="file" value="浏览" style="display: none;"                      onchange="document.uploadfile.filePath.value=this.value"/>  <input type="text" name="filePath" id="filePath"/>  <input type="button" value="浏览..." onclick="document.uploadfile.my.click()"/><br>  <input type="submit" value="上传" id="shangchuan">  </form>
原创粉丝点击