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