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
Post a Comment