A
A
Alexis_D2019-07-11 10:01:12
JavaScript
Alexis_D, 2019-07-11 10:01:12

How to delete a file loaded by a plugin?

Good day, there is a WordPress + WooCommerce online store , there is a WooCheckout plugin that allows you to upload files and found such a bug there, when I upload, for example, a picture is displayed there is a thumbnail of this picture and a couple more buttons, one of which is deletion, I click delete - the loading indicator just appears and that's it, you can reload the page, because absolutely nothing happens next, I tried to reinstall this plugin, but without results.
I decided to try to clear the input with type='file' myself, I was looking for options, here is one of them:

<form>
  <input id="file" type="file">
</form>

<button onclick="reset($('#file'))">Reset file</button>

window.reset = function(e) {
  e.wrap('<form>').closest('form').get(0).reset();
  e.unwrap();
}

I checked it on a test file, everything works, and in the examples (on jsfiddle) everything works, but when I tried to do the same only with these files (provided by the plugin), nothing comes out.
What could it be, how to solve this problem?
Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question