title: Enable button on a page when fields in a particular form is filled
body: <p>I have two forms on a page and i want to activate a particular button on a form when all fields in a particular form is filled, but with my current script when a particular form fields are filled and the rest of fields of the other form on the page are not filled the button still remains inactive</p>
  
  <pre><code>&lt;form method=post id="regis"&gt;
      &lt;p&gt;Register&lt;/p&gt;
      &lt;p&gt;
          &lt;input name="username" type="text" id="first_name"&gt;
          &lt;input name="password" type="text" id="second_name"&gt;
          &lt;input type="submit" value="register" id="register" disabled&gt;
      &lt;/p&gt;
  &lt;/form&gt;
  &lt;p&gt;
      &lt;label for="textfield"&gt;&lt;/label&gt;
      &lt;label for="textfield2"&gt;&lt;/label&gt;
  &lt;/p&gt;
  &lt;form name="form1" method="post" action=""&gt;
      &lt;p&gt;Login&lt;/p&gt;
      &lt;p&gt;
          &lt;label for="password2"&gt;&lt;/label&gt;
          &lt;input type="text" name="email2" id="textfield2"&gt;
          &lt;label for="textfield3"&gt;&lt;/label&gt;
          &lt;input type="text" name="password2" id="textfield3"&gt;
          &lt;input type="submit" value="login" id="login2" disabled&gt;
      &lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready(function () {
      var $input = $('input:text'),
          $register = $('#register');
      $register.attr('disabled', true);
  
      $input.keyup(function () {
          var trigger = false;
          $input.each(function () {
              if (!$(this).val()) {
                  trigger = true;
              }
          });
          trigger ? $register.attr('disabled', true) : $register.removeAttr('disabled');
      });
  });
  </code></pre>