修改文件上傳按鈕的樣式

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;"                      οnchange="document.uploadfile.filePath.value=this.value"/>
  <input type="text" name="filePath" id="filePath"/>
  <input type="button" value="瀏覽..." οnclick="document.uploadfile.my.click()"/><br>
  <input type="submit" value="上傳" id="shangchuan">
  </form>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章