Capturing cancel event on input type=file

后端 未结 3 1827
深忆病人
深忆病人 2021-02-09 10:44

I have a html5 application that makes use of the file API, using an element. I am able to respond when the user selects a file. I would like to be able to do something if the u

3条回答
  •  借酒劲吻你
    2021-02-09 11:05

    I have the same question, the solution is surprisingly very easy ... at least in my case NW.js (Node-Webkit) fires oncancel event if user click the [cancel] button in the file chooser dialogue. You use this simple and native way if you're also on NW.js (process.version is v5.11.0).

    I also tried Microsoft HTA on Windows 10, it does not fire the oncancel event.

提交回复
热议问题