Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Uncaught TypeError: Object #<an Object> has no method 'onchange' Commented Nov 19, 2010 at 6:40
  • .change works. But it's still no good, as while it errors, it still selects and is showing the file on the page. Commented Nov 19, 2010 at 6:42
  • Adding this worked, ".val('');" but I don't know how compliant that is... anyone? Commented Nov 19, 2010 at 6:44
  • 1
    .val(''); is a jQuery call, and all it does is set the value attribute of the element to be '' - which is the same is was on page load. Commented Nov 19, 2010 at 6:50
  • 1
    For googlers; AFAIK not all browsers allow you to reset a file input's value. The most elegant crossbrowser solution I have found is element.wrap('<form>').closest('form').get(0).reset(); element.unwrap();
    – Maurice
    Commented Jan 29, 2013 at 9:45