Any alternative to jQuery change() to detect when user selects new file via dialog box in IE8?

Posted by ecu on Stack Overflow See other posts from Stack Overflow or by ecu
Published on 2010-06-07T23:47:26Z Indexed on 2010/06/07 23:52 UTC
Read the original article Hit count: 160

Filed under:
|
|

I am unable to detect when input type="file" changes its value after user selects file and the dialog box closes.

$('.myInput').change(function(){
    alert($(this).val());
})

Above jQuery code works perfectly in all browsers apart from IE. For some reason IE detects the change only after input field loses focus.

Is there a way to detect the change immediately after dialog box closes? Or maybe to force input field to lose focus after dialog box closes so IE can detect it?

I'm puzzled. Thanks for any help.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery