title: Using jQuery to tell if file input field is empty
body: <p>I have a PHP form with a file input field, and two text input fields. What I want to do is use jQuery to check if the file input field is empty, and if it's not, then show a specific div, but the following code does not work:</p>
  
  <pre><code>&lt;input type="file" name="blog-entry-image" id="blog-entry-image" /&gt;
  
  var fileInput = $.trim($("#blog-entry-image").val());
  if (fileInput.length &gt; 0) {
          $("#new-blogentry").click(function() {
          $("#sending").show();
          return true;
      }); 
  }
  </code></pre>
  
  <p>"new-blogentry" is the submit button, and "sending" is a div with an animated gif.</p>