title: Best Way To Disable Button In Form When Required Fields Are Not Entered
body: <p>The code below disables the submit button of form if all required fields are not filled out. Problem is if it is filled out then afterwards erased the button stays enabled. How do I fix that?</p>
  
  <pre><code>$(".submit").prop('disabled', true);
  $('.required').keyup(function () {
      if ($(".fname").val() != "" &amp;&amp; $(".lname").val() != "" &amp;&amp; $(".userName").val() != "" &amp;&amp; $(".familyRav").val() != "" &amp;&amp; $(".birthday").val() != "" &amp;&amp; $(".password").val() != '' &amp;&amp; $(".confirm_password").val() != '' &amp;&amp; $(".password").val() ===  $(".confirm_password").val()) {
          $(".submit").prop("disabled", false);
  
      }
  });
  </code></pre>