Simulating Click Event of Input File Control through Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paragbhavsar
    New Member
    • Nov 2009
    • 1

    Simulating Click Event of Input File Control through Javascript

    Hello Friends,

    Can we simulate click event of Input File Control through Javascript - I want this for Firefox 3.5 browser ?

    I have also tried with following code. Please let me know solution about this.

    Code:
    <pre>
    <a id="myobj" href="#" onclick="document.getElementById('test').click();
    ">Click me</a>
    <input type="file" id="test" name="test" >
    </pre>
    Thanks for helping me quickly in Advance.

    Waiting for reply from Experts.

    - PARAG BHAVSAR
    Last edited by Dormilich; Nov 30 '09, 12:30 PM. Reason: Please use [code] tags when posting code
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    What do you need this for?

    If it's for styling, see http://www.quirksmode.org/dom/inputfile.html

    Comment

    Working...