views:

33

answers:

2

I have a file upload control <input id="File1" type="file" /> in my page... How to check an input type="file" has a file or not using jquery on click of a button upload?

+2  A: 
if (jQuery('#File1').val()) {}
David Dorward
+1  A: 
$('#upload').bind('click', function(e){
   if( $('#File1').val() != ""){
       // file selected
   }
   else{
       // no file selected
   }
});

Kind Regards

--Andy

jAndy