Skip to content Skip to sidebar Skip to footer

Cross Browser Open File Browse Dialog

I've been looking for that holy grail - nice file dialogs in HTML. I've come up with a solution that uses jQuery to click() the (hidden) file element when a button is clicked. This

Solution 1:

This might be some years late, but here's is a way of doing it without any Javascript and it's also cross browser.

<label>
  Open file dialog
  <input type="file" style="display: none">
</label>

In case you find problems, you may need to use the for attribute in the label pointing to the id of the input.


Solution 2:

Try using trigger():

$(this).parents(".formFile").find("input[type='file']").trigger('click');

Post a Comment for "Cross Browser Open File Browse Dialog"