Input type FILE multiple - add files sequentially

后端 未结 2 1353
梦如初夏
梦如初夏 2021-02-06 18:03

I am developing a page (one-time use - its registration page) when a visitor opens dialog box and uploads files throught input type file multiple. All worked fine, but my client

2条回答
  •  眼角桃花
    2021-02-06 18:43

    Note on the "classic form"/JQuery solution given by Gregoire: this will not work on the newly added inputs, as the listener is not active on them. If you modify this to use delegated events you have a working clean solution:

    $("#files").on("change", "input", function(event){ $('#files').append('') });

提交回复
热议问题