title: Clone a row if previous row has data
body: <p>I have the following <a href="https://jsfiddle.net/fqugd7vL/20/" rel="nofollow">Fiddle</a> set up.  I display a table row to the user.  There is the option to add and remove table row.</p>
  
  <p>At the moment, this works fine.  Adding a table row makes use of cloning a hidden row.</p>
  
  <pre><code>function add_row($table) {
      var tr_id = $table.find('tr').length - 1;
      var $template = $table.find('tr.template');
  
      var $tr = $template.clone().removeClass('template').prop('id', tr_id);
  
      $tr.find(':input').each(function() {
          if($(this).hasClass('hasDatepicker')) {
              $(this).removeClass('hasDatepicker').removeData('datepicker');
          }
  
          var input_id = $(this).prop('id');
          input_id = input_id + tr_id;
          $(this).prop('id', input_id);
  
          var new_name = $(this).prop('name');
          new_name = new_name.replace('[0]', '['+ tr_id +']');
          $(this).prop('name', new_name);
  
          $(this).prop('value', '');
      });
      $table.find('tbody').append($tr);
  
      $(".dateControl", $tr).datepicker({
          dateFormat: "dd-mm-yy"
      });
  
      $(".selectType", $tr).select2({
          tags: true
      });
  }
  </code></pre>
  
  <p>One problem I am having is that I only want it to clone a new row if at least one of the three inputs has some data.  So if they are
  all empty, it should not allow a new row to be added.  I have been trying something like this without success</p>
  
  <pre><code>$('#table1 &gt; tbody  &gt; tr').each(function() {
      var inputsVal = $('td:eq(0) input', this).val();
      alert(inputsVal);
  });
  </code></pre>
  
  <p>How would I make it only allow a new row to be added if at least one of the inputs has a value?</p>
  
  <p>Thanks</p>