Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete the value of an "input type=file" [duplicate]

I want to know how to delete the value of an input type file with Jquery.

More precisely what I call the value is when you upload a file from this input, but you haven't send the form.

I hope i'm understandable.

like image 830
KeizerBridge Avatar asked May 16 '13 19:05

KeizerBridge


People also ask

How do you clear the value of an input type file?

We can clear the file input with JavaScript by setting the value property of the file input to an empty string or null .

How do I delete a file in HTML?

Right-click the files again and choose "Delete." Click "Yes" to confirm the deletion. Repeat this process to delete all the HTML read-only files on the computer.

How do you delete selected files in HTML?

text(Object. keys(clon). length + " file(s) selected"); }); }); function BorrarFile(id){ // handling file deletion from clone jQuery("#file"+id). remove(); // remove the html filelist element delete clon[id]; // delete the entry removedkeys++; // add to removed keys counter if (Object.


1 Answers

You can do:

$(document).ready(function(){     $('input').val("");  }); 
like image 172
edonbajrami Avatar answered Sep 28 '22 03:09

edonbajrami