天天看點

修改檔案上傳按鈕的樣式

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>
           

繼續閱讀