SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru bronze trophy
    Join Date
    Dec 2003
    Location
    Poland
    Posts
    930
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    How to auto-open file dialog window, cross-browser?

    I have an <input type="file"> field and I would like the file chooser dialog to open automatically after the page loads, for example on onload(). I have found a trick with executing click() in js on the file element but it seems to only work in IE. Are there any methods that would work in FF and other browsers as well?

  2. #2
    SitePoint Evangelist TommiChi's Avatar
    Join Date
    Oct 2008
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem with forcing a click action on an element is that Firefox does not recognize this on elements that are not of type button.

    You could try prototyping a click action on the target element, but I'm not even sure that this would work

    What you are trying to do may be better achieved by running a server-side script.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •