javascript - Jquery change event not working -
i have html:
<form id="fileuploadform"> <input type="file" id="fileupload" name="fileupload" /> </form>
and jquery:
$(':file').change(function(){ var file = this.files[0]; ... });
the problem is: change function fires when file selection different selection made previously. of course meaning of 'change' event. want function called file dialog closes, no matter what.
i tried using 'select' event -- never gets called
i tried:
$(':file').bind('dialogclose', function(event) { alert('closed'); });
and:
$(':file').live("dialogclose", function(){ alert('closed1'); });
they didn't work either.
try use code.
$('#fileupload').on('change', function () { alert('hi'); //do function. });
this function call select different files otherwise not.
Comments
Post a Comment