title: How to properly check if all form elements are filled with JavaScript
body: <p>I have a form:</p>
  
  <pre><code>&lt;form action="process.php" method="POST" enctype="multipart/form-data" id="add_prod_form"&gt;
  Item Name: &lt;input type="text" name="add_prod_name" id="add_prod_name"/&gt;&lt;br /&gt;&lt;br /&gt;
  Image 1: &lt;input type="file" name="add_prod_image[]" id="add_prod_image"/&gt;&lt;br /&gt;&lt;br /&gt;
  Image 2: &lt;input type="file" name="add_prod_image[]" /&gt;&lt;br /&gt;&lt;br /&gt;
  Image 3: &lt;input type="file" name="add_prod_image[]" /&gt;&lt;br /&gt;&lt;br /&gt;
  Image 4: &lt;input type="file" name="add_prod_image[]" /&gt;&lt;br /&gt;&lt;br /&gt;
  Image 5: &lt;input type="file" name="add_prod_image[]" /&gt;&lt;br /&gt;&lt;br /&gt;
  Short description:&lt;br /&gt;
  &lt;textarea rows="7" cols="50" name="add_prod_description_short" id="add_prod_description_short"/&gt;&lt;/textarea&gt;&lt;br /&gt;
  Long description:&lt;br /&gt;
  &lt;textarea rows="7" cols="50" name="add_prod_description_long" id="add_prod_description_long"/&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;
  Price: &lt;input type="text" name="add_prod_price" id="add_prod_price"/&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;input type="hidden" name="action" value="add_product" /&gt;
  &lt;input type="submit" name="submit" id="add_prod_submit" disabled="disabled"&gt;
  </code></pre>
  
  <p>And I have a small script:</p>
  
  <pre><code>&lt;script&gt;
  $('#add_prod_name, #add_prod_image, #add_prod_description_short, #add_prod_description_long, #add_prod_price').keyup(function() {
      if(allFilled()){
           $('#add_prod_submit').removeAttr('disabled');
      }
  });
  
  function allFilled() {
      var filled = true;
      $('#add_prod_form input, #add_prod_form textarea').each(function() {
          if($(this).val() == '') filled = false;
      });
      return filled;
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>What I am expecting is that once all the fields are filled, the submit button becomes available.It does not. Unfortunately I can't just check all the "body input" elements as there is another form on the same page. I have a feeling my problem lies somewhere in the <code>$('#add_prod_form input, #add_prod_form textarea').each(function()</code> section but I have tried about 100 ways and nothing works.</p>
  
  <p>I am currently adapting code I found <a href="https://stackoverflow.com/questions/5614399/disabling-submit-button-until-all-fields-have-values">here</a></p>