title: check if input file filed is empty jquery
body: <p>I have a form with a file input and I want to check if it is empty when the form is submitted.</p>
  
  <p>I have this code:</p>
  
  <pre><code>$('form#new_comment').submit(function(e) {
     var $this = $(this);
     var $input =  $this.find('input').val();
   if($($input == '')) {
     alert ("you must choose a image");
     return false; 
     e.preventDefault(); 
    }    
  });  
  </code></pre>
  
  <p>But it always says <code>you must choose a image</code>, even when I have chosen an image.</p>
  
  <p>Where is the problem?</p>