sdfgg45 sdfgg45 - 1 year ago 100
jQuery Question

How to clear the img placeholder for choose image using jQuery

I have a form with fileupload.

<input class="file" type="file" name="files[]">

I am curently cloning the input, but if a file is choosen it also clones the choosen filinput, is there a way to clear the selected image?


fieldset-content_doc: holds the formvalues

Answer Source

Apparently the issue is only reproducible on Firefox. But, you can simply set the value property of the element to null:

    .each(function() { this.value = null; });

See Fiddle

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download