title: Jquery validation for one row out of 5 row
body: <p>i have a form with five table row. so i want to validate that whether one user filled any one row completely.</p>
  
  <p>Here is my code snippet </p>
  
  <pre><code>&lt;div class="full_width_structure"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;label&gt;Name :&lt;/label&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;label&gt;Designation :&lt;/label&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;label&gt;Type :&lt;/label&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;label&gt;Contact No&lt;/label&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;label&gt;Address&lt;/label&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="text" name="name1" class="required[0]" rel="Name" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="designation1" class="required[1]" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select name="type1"&gt;
                      &lt;option&gt;Rural&lt;/option&gt;
                      &lt;option&gt;Urban&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="contactnum1" class="required[2] contactno" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;textarea name='address1' class="required[3] textarea autoHeightTextarea"&gt;&lt;/textarea&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="text" name="name2" class="" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="designation2" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select name="type2"&gt;
                      &lt;option&gt;Rural&lt;/option&gt;
                      &lt;option&gt;Urban&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="contactnum2" class="validate[required] text-input"
                  /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;textarea name='address2' class="validate[required] textarea autoHeightTextarea"&gt;&lt;/textarea&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="text" name="name3" class="validate[required] text-input"
                  /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="designation3" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select name="type3"&gt;
                      &lt;option&gt;Rural&lt;/option&gt;
                      &lt;option&gt;Urban&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="contactnum3" class="validate[required] text-input"
                  /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;textarea name='address3' class="validate[required] textarea autoHeightTextarea"&gt;&lt;/textarea&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="text" name="name4" class="validate[required] text-input"
                  /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="designation4" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select name="type4"&gt;
                      &lt;option&gt;Rural&lt;/option&gt;
                      &lt;option&gt;Urban&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="contactnum4" class="validate[required] text-input"
                  /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;textarea name='address4' class="validate[required] textarea autoHeightTextarea"&gt;&lt;/textarea&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="text" name="name5" class="validate[required] text-input"
                  /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="designation5" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select name="type5"&gt;
                      &lt;option&gt;Rural&lt;/option&gt;
                      &lt;option&gt;Urban&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="contactnum5" class="validate[required] text-input"
                  /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;textarea name='address5' class="validate[required] textarea autoHeightTextarea"&gt;&lt;/textarea&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  &lt;!-- full_width_structure --&gt;
  </code></pre>
  
  <p>so here one row will have name, designation, type , contact number address.
  one user can fill maximum of five entries. because only five static row is exist. so i want to code jquery validation to check whether one user filled one row completely or not.</p>
  
  <p>if he entered one row completely then submit otherwise return false.</p>
  
  <p>My current validation code </p>
  
  <pre><code>// not working as expected 
  
  $('#policestationForm input,#policestationForm .autoHeightTextarea').each(function () {
      var thisObj = $(this);
      $(this).focus(function () {
          if (noEmptyExists(thisObj)) {
              if ($(this).val() === 'This Field Required') {
                  $(this).val('').removeClass('error_notification');
              }
          } else {
              console.log('no');
          }
      });
  
      /*
       * Blur 
       */
      $(this).blur(function () {
          if (!noEmptyExists(thisObj)) {
              $(this).addClass('error_notification').val('This Field Required');
              runHideEffect(thisObj);
          } else {
  
          }
      });
  });
  
  /*
   * Submitt form validation 
   */
  $('#policestationBtn').submit(function () {
      $('#policestationForm input,#policestationForm      .autoHeightTextarea').each(function () {
  
      });
  });
  
  });
  
  function noEmptyExists(thisObjParam) {
      return $(thisObjParam).filter(function () {
          return !$.trim(this.value);
      }).length === 0;
  }
  
  function runHideEffect(thisHideObj) {
      setTimeout(function () {
          thisHideObj.val('').removeClass('error_notification');
      }, 10000);
  }
  </code></pre>