File inputs have traditionally been difficult to modify, for security reasons. AFAIK, it shouldn't work in FF, either. Maybe it works only because you're emptying it. I wonder if that would work if you tried to set the value to some other string.
On Mon, Feb 9, 2009 at 11:39 AM, ezod <pured...@gmail.com> wrote: > > Hi there, > > I tried to "reset" a file input element by using "val()". > > <html> > <head> > <title>FooBar</title> > </head> > <script src="jquery.js"></script> > <script> > $(document).ready(function() { > > $("#resetMe").click(function () { > $("#input1").val(''); > }); > }); > </script> > <body> > > <form name="foo"> > <input id="input1" type="file" name="foobar"> > <br><br> > <input id="resetMe" type="button" value="ResetMe!"> > </form> > > </body> > </html> > > This works fine for FF, but IE doesn´t (re)set the value. > > Any hints? > > TIA > ezod >