I totally missed the fact it was a file and not a text type, my bad _-_
cheers

Michael Lawson
Content Tools Developer, Global Solutions, ibm.com
Phone:  1-919-517-1568 Tieline:  255-1568
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


                                                                       
  From:       ezod <pured...@gmail.com>                                
                                                                       
  To:         "jQuery (English)" <jquery-en@googlegroups.com>          
                                                                       
  Date:       02/10/2009 06:52 AM                                      
                                                                       
  Subject:    [jQuery] Re: input file and val()                        
                                                                       






Great idea Adrian, but you can´t change the type property ;)

Well, you could also remove the element from the DOM and then add it
again...



On 10 Feb., 11:48, Adrian Lynch <adely...@googlemail.com> wrote:
> Maybe recreate the input and replace the existing one?
>
> Or turn it into text type, clear the value then back to file?
>
> Just guessing mind!
>
> Adrian
>
> On Feb 10, 8:45 am, ezod <pured...@gmail.com> wrote:
>
> > Hi Michael,
>
> > unfortunately that doesn´t work either (except FF ;))
>
> > On 9 Feb., 17:44, Michael Lawson <mjlaw...@us.ibm.com> wrote:
>
> > > Have you tried using the attr() function?
> > > $("#input1").attr("value","");)
>
> > > cheers
>
> > > Michael Lawson
> > > Content Tools Developer, Global Solutions, ibm.com
> > > Phone:  1-919-517-1568 Tieline:  255-1568
> > > E-mail:  mjlaw...@us.ibm.com
>
> > > 'Examine my teachings critically, as a gold assayer would test gold.
If you
> > > find they make sense, conform to your experience, and don't harm
yourself
> > > or others, only then should you accept them.'
>
> > >   From:       ezod <pured...@gmail.com>

>
> > >   To:         "jQuery (English)" <jquery-en@googlegroups.com>

>
> > >   Date:       02/09/2009 11:40 AM

>
> > >   Subject:    [jQuery] input file and val()

>
> > > 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
>
> > >  graycol.gif
> > > < 1 KBAnzeigenHerunterladen
>
> > >  ecblank.gif
> > > < 1 KBAnzeigenHerunterladen
>
>

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

Reply via email to