jQuery auto upload file

前端 未结 2 1438
-上瘾入骨i
-上瘾入骨i 2020-12-31 05:33

I want the file input will automatic upload my image without enter any submit button.

相关标签:
2条回答
  • 2020-12-31 05:52

    With more recent versions you can also just set the autoUpload option to true:

    $('#fileupload').fileupload({ autoUpload: true });
    
    0 讨论(0)
  • 2020-12-31 05:57

    You can submit the form on the file input's onchange event, like this:

    $("input[name=upload]").change(function() {
        $(this).closest("form").submit();
    });
    
    0 讨论(0)
提交回复
热议问题