title: How to validate old password when i change a new password
body: <p>I have a form for editing a user account, there I give input-field contains the new password and the old password. If the new password field is not filled in, the data will be stored, and if the new password field filled in the old password field must be filled, then how do I have to provide validation? The New password is not equal to old password.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
       &lt;label class="control-label"&gt;Current Password&lt;/label&gt;
       &lt;input type="password" name="currentPassword" class="form-control"&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label class="control-label"&gt;New Password&lt;/label&gt;&lt;input type="password" name="newPassword" id="newPassword" class="form-control"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Any suggestion ?</p>