Reputation: 370
I am working on file uploading. So when I click cross button how can I remove exited file using php without page reload?
Upvotes: 0
Views: 3170
Reputation: 7688
jQuery version
$("#id").attr('value', '');
or $("#id").val('');
Also check out this article: http://www.learningjquery.com/2007/08/clearing-form-data
Upvotes: 2
Reputation: 15338
if you're using jQuery:
$("#remove").click(function(){
$("#fileInput").val("");
return false;
})
Upvotes: -1
Reputation: 10539
You can, with javascript
document.getElementById("fileInput").value = "";
How can I remove exited file using php without page reload?
You can't, PHP is server side language
Upvotes: 8