Clear upload file input box
It is impossible to clear upload file input box. The only standard thing u can use is a .reset() method of the form but it is not good. It will reset all other fields. File input box is READ ONLY, however there is a trick you can do.
The trick is basically to re-create the field from scratch.
Using a jQuery:
$("#filefield_id").parent().html($("#filefield_id").parent().html());
Standard Javascript:
document.getElementById("filefield_id").innerHTML = document.getElementById("filefield_id").innerHTML;
Dima Svirid
Software architect. Ajax/Javascript, HTML5, Android, iPhone/iPad, JAVA, PHP, Cold Fusion, SQL, Air, Flash, Open source software, Frameworks
One Response to Clear upload file input box
Leave a Reply Cancel reply
You must be logged in to post a comment.
SEARCH ARTICLES & TUTORIALS
MOST POPULAR TUTORIALS
Generating PDF Documents with Adobe Air Javascript SDK and jQuery
I am not a Flex guy and I don't think I will ever be. While searching [...]
Search Engine Optimization - Do It Yourself!
This is Part 1 of "Search Engine Optimization – Do It Yourself!" ser[...]
jQuery Object Oriented Plugins
Many people have asked me, if jQuery is object oriented and how they c[...]
Spring-MVC Tutorial (Part 1)
Overview This document is a step-by-step guide on how to de[...]
Animated scroll to anchor method with jQuery
It's a one line but can add a really nice effect to your website. f[...]
RECENT POSTS
How to calibrate Samsung Galaxy battery
There is no guarantee that this method will work for you. However it d[...]
Real Estate Social Network new Toronto Startup
Wanted to write for a long time about a new startup for Real Estate ag[...]
Eclipse Keyboard Shortcuts for Developers
Eclipse Navigation Shortcuts Every Java Programmer Should Know Ctrl [...]
Duplicated Content
This is Part 4 of "Search Engine Optimization – Do It Yourself!" ser[...]
301 Redirect
There are many ways how you can do 301 redirect, I will mention just t[...]





Nice trick