javascript - IE change event on file input -


i trying fire custom function when gets changed. i'm triggering input through button(which has custom styling). when input triggered button, change event doesn't fire, if click "browse" button of input event fires properly.

is there way can fix this?

note: using delegate since input gets added dynamically.

here's setup:

$("#parent") .delegate(".browse","click",function(){     $(this).siblings("input[type='file']").trigger("click"); }) .delegate("input[type='file']","change",function(e){     alert("changed"); }) 

here's fiddle: http://jsfiddle.net/np88n/1/

$("#parent") .delegate(".browse","click",function(){     $(this).siblings("input[type='file']").trigger("click"); }) 

change in

 $("#parent")     .delegate(".browse","click",function(){         $(this).siblings("input[type='file']").trigger("change");     }) 

Comments

Popular posts from this blog

ruby - re-try logic in a simple loop -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

Laravel Bind Multiple Class to One Contract in The Service Provider -