Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery file upload - get the "Open" event from the dialog window

Does anyone know how can I find out when the "Open" button was clicked in the dialog window of the file upload?

I just want to do some checks once this has happened (validation etc.) and then perform the upload automatically.

Also - I don't want to use any plugins as I know there are a few.

like image 576
user398341 Avatar asked Aug 11 '10 06:08

user398341


1 Answers

But the file dialog opens upon clicking on the <input type="file" /> field.

So you could even do..

$("#element").click({
   //dialog opening now
});

.change() would trigger only if you actually select something that differs from the previous value, if I'm not wrong.

like image 69
Robin Maben Avatar answered Oct 03 '22 07:10

Robin Maben