首頁  >  文章  >  web前端  >  把檔案上傳按鈕修改成自己喜歡的樣式

把檔案上傳按鈕修改成自己喜歡的樣式

一个新手
一个新手原創
2017-09-07 13:52:511977瀏覽

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>


以上是把檔案上傳按鈕修改成自己喜歡的樣式的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn