[Javascript] Programmatically invoke the file browse dialog of input type=file

Gaz Newt newtquest at yahoo.co.uk
Sat Sep 30 08:28:52 CDT 2006


Ok thanks.

I didn't fancy doing a browser sniff to serve different behaviour so I do the .click() and if the page hasn't lost focus within 50ms (indicating that the file dialog has appeared) I show the iframe with the "Browse" button on it.

Works great!

Flávio Gomes <flavio at economisa.com.br> wrote: I don't believe it's possible or easy to do.

If you check GMail on Firefox you'll see they use the standard "input file".

Gaz Newt escreveu:

> I want to have a separate button which invokes the "browse" button on 
> an input type=file. In internet explorer the following code works ok, 
> in firefox nothing happens.
>
> All I do is call click() for the input control.
>
> Do you know how to make this work in firefox?
>
> Thanks
>
>
> 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 
>
> 
Test>     
>     
>     
>     function test()
>     {
>         var oTest = document.getElementById( "mytest");
>         oTest.click();
>     }
>     
> 
>
> 
>
> 
>      [input] 
>     

>      [input] 
> 
> 
>
> 
>
> ------------------------------------------------------------------------
> The all-new Yahoo! Mail 
>  
> goes wherever you go - free your email address from your Internet 
> provider.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript
>  
>

-- 
Flavio Gomes
flavio at economisa.com.br

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


 		
---------------------------------
 To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060930/6fe93322/attachment.htm>


More information about the Javascript mailing list