cancel
Showing results for 
Search instead for 
Did you mean: 

OK, we have HTML5 / CSS guru's but do we have jQuery ones?

Anonymous
Not applicable

OK, we have HTML5 / CSS guru's but do we have jQuery ones?

Hi,
I thought it wouldn't do any harm to ask. I have a button on my web site that when click displays an <input> element for files. In order to select a file the user then of course needs to click the Browse button. Is there a way I can get round this by using jQuery to automatically display the File Selection dialog box for me when the user clicks my 'Upload' button?
In case this helps for control reasons the <input> element is not used inside of a form element.
4 REPLIES 4
Townman
Superuser
Superuser
Posts: 16,935
Thanks: 7,024
Fixes: 67
Registered: ‎22-08-2007

Re: OK, we have HTML5 / CSS guru's but do we have jQuery ones?

Mook,
Try this for starters.
You can often answer questions like this by just typing in the keywords in Google - for example, to find this I searched on "html javascript open file dialog"
Kevin
Anonymous
Not applicable

Re: OK, we have HTML5 / CSS guru's but do we have jQuery ones?

I can take a hint!
$('#upload input[type=file]').click() ;
Does the trick. 🙂
Townman
Superuser
Superuser
Posts: 16,935
Thanks: 7,024
Fixes: 67
Registered: ‎22-08-2007

Re: OK, we have HTML5 / CSS guru's but do we have jQuery ones?

There is a fine line between a "hint" and a guidance towards the source of answers  Wink Cheesy
I have found no end of answers to things I knew nothing about following the above approach.  Often you can find practical worked through solutions which you will not find in technical texts.
The big hint is on your other thread...
Anotherone
Community Veteran
Posts: 19,107
Thanks: 455
Fixes: 21
Registered: ‎31-08-2007

Re: OK, we have HTML5 / CSS guru's but do we have jQuery ones?

Quote from: Townman
You can often answer questions like this by just typing in the keywords in Google - for example..............

You should also note that it can frequently lead you a lot of repeatedly misguided and misquoted information unless you bother to double/triple check the accuracy of any information that it may turn up