|
asp.net upload faq
» Intro
» How to
» Quickstart
» Advanced
» Troubleshoot
resources
» Download Source Code
» ASP.NET Upload Control
search site
|
Clear HTML File Input
Share this page with friends, or bookmark it for yourself:
An HTML file input can't be cleared by normal means (i.e. setting the value to null or an empty string), but because of browser security restrictions, most browsers don't allow this. In many browsers, setting a null value attribute either will have no effect or cause an error. Instead, create a new element that clones the old element and swap the two. Here's an example: Page HTML:
Javascript code to clear the file input:
© 2010 Krystalware
|
Painless ASP.NET file uploads
|