Skip to main content

Bug Tracker

Side navigation

#12917 closed bug (plugin)

Opened November 19, 2012 03:34PM UTC

Closed November 19, 2012 10:34PM UTC

input type[file] can't be reset with val('') in IE (+ workaround)

Reported by: Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:

Due to IE's inane security manager, you can't set the value of an input[file], even to "" to reset it.

There's a workaround that might be useful to pull into jQuery. It wraps a form around the input element, calls reset on it, then removes the parent element:

function reset(e) {




This workaround works in all browsers:

Attachments (0)
Change History (1)

Changed November 19, 2012 10:34PM UTC by timmywil comment:1

component: unfiledattributes
priority: undecidedlow
resolution: → plugin
status: newclosed

Sounds like this would be good for a jQuery plugin like file upload.