title: Reset Password Using Html and javascript
body: <p>I Have a requirement where i have 3 input fields namely </p>
  
  <blockquote>
    <p>1.old password<br/>
     2.new password<br/>
     3.confirm password.</p>
  </blockquote>
  
  <p>For which i need to apply rules as follows.</p>
  
  <blockquote>
    <p>1.Old and new passwords should not match.<br/>
    2.No field should be empty.<br/>
    3.New password and confirm password inputs should be same.</p>
  </blockquote>
  
  <p><strong>If all these validations passes then only form should be submitted.</strong><br/>
  Here is the Html file for which i need to apply js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form role="form" method="post"&gt;
      &lt;div class="box box-primary"&gt;
          &lt;div class="box-header"&gt;
              &lt;h2 class="page-header"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt; Change Password&lt;/h2&gt;
              &lt;div class="pull-right"&gt;
                  &lt;button type="button" name="Submit" value="Save" class="btn btn-danger"&gt;&lt;i class="livicon" data-n="pen" data-s="16" data-c="#fff" data-hc="0" &gt;&lt;/i&gt; Save&lt;/button&gt;
                  &lt;button type="reset" name="Reset" value="Clear" class="btn btn-primary"&gt;&lt;i class="livicon" data-n="trash" data-s="16" data-c="#fff" data-hc="0"&gt;&lt;/i&gt; Clear&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!-- /.box-header --&gt;
  
          &lt;div class="box-body"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-xs-12 col-sm-3 col-md-3"&gt;
                      &lt;label&gt;Old Password&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="col-xs-12 col-sm-3 col-md-3"&gt;
                      &lt;div class="input-group"&gt;
                          &lt;div class="input-group-addon"&gt;
                              &lt;i class="fa fa-lock"&gt;&lt;/i&gt;
                          &lt;/div&gt;
                          &lt;input class="form-control" id="oldPassword" name="oldPassword" value="" placeholder="Enter the Old Password" type="password"&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;!-- /.input group --&gt;
              &lt;/div&gt;
              &lt;br/&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-xs-12 col-sm-3 col-md-3"&gt;
                      &lt;label&gt;New Password&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="col-xs-12 col-sm-3 col-md-3"&gt;
                      &lt;div class="input-group"&gt;
                          &lt;div class="input-group-addon"&gt;
                              &lt;i class="fa fa-lock"&gt;&lt;/i&gt;
                          &lt;/div&gt;
                          &lt;input class="form-control" id="newPassword" name="newPassword" value="" placeholder="Enter the New Password" type="password"&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;!-- /.input group --&gt;
              &lt;/div&gt;
              &lt;br/&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-xs-12 col-sm-3 col-md-3"&gt;
                      &lt;label&gt;Confirm Password&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="col-xs-12 col-sm-3 col-md-3"&gt;
                      &lt;div class="input-group"&gt;
                          &lt;div class="input-group-addon"&gt;
                              &lt;i class="fa fa-lock"&gt;&lt;/i&gt;
                          &lt;/div&gt;
                          &lt;input class="form-control" id="confirmPassword" name="confirmPassword" value="" placeholder="Re-enter the New Password" type="password"&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;!-- /.input group --&gt;
              &lt;/div&gt;
  
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>thank you</p>