Require users to confirm their password

Article author
Josh Lopez
  • Updated

Here is a demo site with the code below installed so you can see it in action:


Step 1:

Page header script:
Paste the script below in the <head></head> tag on your website. If you are using webflow, jQuery is already included and this script is not needed.


<script src=""></script>


Page footer script:
Paste the script below just above the </body> tag on your website.


var password = document.getElementById("password");
var confirm_password = document.getElementById("confirm_password");
function validatePassword() {
if (password.value != confirm_password.value) { confirm_password.setCustomValidity("Passwords Don't Match");
} else { confirm_password.setCustomValidity('');
} };
password.onchange = validatePassword();
confirm_password.onkeyup = validatePassword();

NOTE: Remove the ms-field="password" from the second input field. Only one password field should be submitted to Memberstack.


Other resources

Finsweet → Password confirm validation with Webflow Interactions

Was this article helpful?



Please sign in to leave a comment.