Deleting files from form

I am using the following plugin to add images to a form, but I am trying to reset the form within the page.
I can clear all images from the display $(“.uploaded-image”).remove(); but the file data stays within the DOM so remains on a second attempt when submitting the form. I want all the formdata removed to reset the form.

uploader.js (8.8 KB)

So…how are you invoking the plugin?

$(“input-image-one”).imageUploader();

Well I assume there’s a . or a # in there somewhere, cause “input-image-one” isnt an element type.

What happens if you remove the input-image-one container, recreate it, and invoke imageUploader() again?

Yes sorry .class is used.

I haven’t tried that yet, will give that a go.

Yes that does appear to work, the images object on POST still shows an empty filename where the image would have been but I can get around that on server side as it will not store an image if the filename does not exist.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.