Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Lolu chungechunge lwabekwa kunqolobane. Uyacelwa ubuze umbuzo omusha uma udinga usizo.

Problems with clearing files from input type="file"

  • Akukho zimpendulo
  • 5 zinale nkinga
  • 8 views
more options

I'm using ‹input type="file".. to upload files in some javascript.

The page containing the ‹input type="file".. is not reloaded, so data on the ‹input type="file".. is not cleared.

I've done this with form.reset() in IE, which cleares files from ‹input type="file".., but this doesn't work in Firefox. The next time I try to submit a file two files are submitted.

I've even tried to replace the ‹input type="file".. to clear all data, but if i replace it with a ‹input type="file".. with same id, the files is still there from before.

So my question is, how do I clear files selected

(Edited to make the HTML code display properly -TonyE)

I'm using ‹input type="file".. to upload files in some javascript. The page containing the ‹input type="file".. is not reloaded, so data on the ‹input type="file".. is not cleared. I've done this with form.reset() in IE, which cleares files from ‹input type="file".., but this doesn't work in Firefox. The next time I try to submit a file two files are submitted. I've even tried to replace the ‹input type="file".. to clear all data, but if i replace it with a ‹input type="file".. with same id, the files is still there from before. So my question is, how do I clear files selected ''(Edited to make the HTML code display properly -TonyE)''

Okulungisiwe ngu TonyE