Home > Article > Web Front-end > Modify the file upload button to your favorite style
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>
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!