The code is:
<input ID="fileUpload1" runat="server" type="file"
The following works fine:
<input onchange="javascript:alert('hola');" ID="fileUpload1" runat="server" type="file"
I'd like to get this result using jQuery, but that doesn't work:
$('#fileUpload1').change(function (e) {
alert("hola");
});
I am missing something? (Edit: Yes I missed include the *.js file.)
Demo : http://jsfiddle.net/NbGBj/
$("document").ready(function(){
$("#upload").change(function() {
alert('changed!');
});
});
Or could be:
$('input[type=file]').change(function () {
alert("hola");
});
To be specific: $('input[type=file]#fileUpload1').change(...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With