I'd like to make a click event fire on an <input type="file">
tag programmatically.
Just calling click() doesn't seem to do anything or at least it doesn't pop up a file selection dialog.
I've been experimenting with capturing events using listeners and redirecting the event, but I haven't been able to get that to actually perform the event like someone clicked on it.
just use a label tag, that way you can hide the input, and make it work through its related label https://developer.mozilla.org/fr/docs/Web/HTML/Element/Label
This will now be possible in Firefox 4, with the caveat that it counts as a pop-up window and will therefore be blocked whenever a pop-up window would have been.
Here is solution that work for me: CSS:
HTML with "small" JQuery help:
Just be sure that maskfied is covered compeltly by true upload field.
I found that if input(file) is outside form, then firing click event invokes file dialog.