I'm using the blueimp file upload plugin, everything is working fine so far. I have implemented this plugin into my own form, which is submitted through ajax, this is working well too.
Now the problem: after successful submission, I go back to the form, all input fields are cleared, except the file upload list.
this solution should work, and it does when I use in within an onclick function:
https://github.com/blueimp/jQuery-File-Upload/issues/1631
But I don't want to use a separate clear button, I want to clear the form + file list after successful submission, so logically, I wrote this code:
success: function(response) {
// on success
if (response.success === 1) {
$('#fileupload table tbody tr.template-download').remove();
but this doesn't work, even when I just put the line on top, below document.ready (so clear onload).
Why does this only work onclick? Am I missing something? Any suggestions?
Thanks in advance for your assistance