form表單提交文件(input file)


 

包含文件上傳的form表單提交,要添加屬性 enctype="multipart/form-data"

 

 
         

<form method="post" id="create_form" action="" enctype="multipart/form-data">
  <table style="display: table;">
    <tr>
      <td>任務名稱:</td>
      <td><input type="text" id="taskName" name="taskName" maxlength="40"></td>
    </tr>
    <tr>
      <td">操作說明:</td>
      <td><input type="file" id="instructions" name="instructions"></td>
    </tr>
    <tr>
      <td colspan='2'>
        <div>
          <button type="button" id="submit-btn">提交</button>
        </div>
      </td>
    </tr>
  </table>
</form>

 

$("#submit-btn").click(
    function(e){
    $("#create_form").submit(); } )

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM