Home > Web Front-end > JS Tutorial > Modify the file upload button to your favorite style

Modify the file upload button to your favorite style

一个新手
Release: 2017-09-07 13:52:51
Original
2042 people have browsed it

1. Write file upload in the modal box
2. Modify the input to file style
The default is "Select File", which displays the name of the file directly
Solution: Modify the style
The method is as follows:

  <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>
Copy after login


The above is the detailed content of Modify the file upload button to your favorite style. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template