Simulate a click on the Upload button using javascript

  •  04-02-2009, 10:38 AM

    Simulate a click on the Upload button using javascript

    Hello,
     
    I'm trying to simulate a click on the Upload button using javascript. One version of the code I've tried is this one:
     
    var btnUpload = document.getElementById('ajaxUploader__Insert');
    btnUpload.click();
     
    When I do this, I expect the "Choose file" dialog box to show up (same behaviour as when you click on this button with the mouse). Unfortunately it is not working. This generates a full postback, as if the button is not "bind" to the uploader.
     
    Do you know if this is feasible?
     
    Thanks in advance,
     
    Dar
View Complete Thread