How to enable a submit button on a registration form if all the fields are filled out and are valid
<p>i'm new in jquery and i'm having trouble with the submit button on the form i'm trying to create. When the button gets disabled and i want to enabled it again if all the validations return true, it stays disabled. Can somebody please help me figure this out. This is part of my jQuery code:</p>

<pre><code>      //some code...

    $('form&gt;input').blur(function () {
       if (firstName == false || lastName==false || email==false || password1==false || password2==false)
           $('#submitButton').prop('disabled',true);
       if (firstName == true &amp;&amp; lastName == true &amp;&amp; email == true &amp;&amp; password1 == true &amp;&amp; password2 == true) //{ //$('#submitButton').prop('disabled',false);
               $('#submitButton').removeAttr('disabled');
       });

  }); 
</code></pre>

<p>this is part of my HTML code:</p>

<pre><code> &lt;div id="mainDiv"&gt;
    &lt;form&gt;
        &lt;label class="label"&gt;first name:&lt;/label&gt;&lt;input type="text" class="firstName" name="firstName" /&gt;
        &lt;label class="label"&gt;last name:&lt;/label&gt;&lt;input type="text" class="lastName" name="lastName" /&gt;
        &lt;label class="label"&gt;email address:&lt;/label&gt;&lt;input type="text" class="email" name="email" /&gt;
        &lt;label class="label"&gt;create password:&lt;/label&gt;&lt;input type="password" class="password1" name="password" /&gt;
        &lt;label class="label"&gt;confirm password:&lt;/label&gt;&lt;input type="password" class="password2"/&gt;
        &lt;input type="submit" id="submitButton" value="register" /&gt;
    &lt;/form&gt;
 &lt;/div&gt;
</code></pre>