title: how to check confirm password field in form without reloading page
body: <p>I have a project in which I have to add a registration form and I want to to validate that the password and confirm fields are equal without clicking the register button.</p>
  
  <p>If password and confirm password field will not match, then I also want to put an error message at side of confirm password field and disable registration button.</p>
  
  <p>following is my html code..</p>
  
  <pre><code>&lt;form id="form" name="form" method="post" action="registration.php"&gt; 
      &lt;label &gt;username : 
  &lt;input name="username" id="username" type="text" /&gt;&lt;/label&gt; &lt;br&gt;
      &lt;label &gt;password : 
  &lt;input name="password" id="password" type="password" /&gt;&lt;/label&gt;     
      &lt;label&gt;confirm password:
  &lt;input type="password" name="confirm_password" id="confirm_password" /&gt;
      &lt;/label&gt;
  &lt;label&gt;
    &lt;input type="submit" name="submit"  value="registration"  /&gt;
  &lt;/label&gt;
  </code></pre>
  
  <p>Is there any way to do this? Thanks in advance for any help.</p>