@@ -118,6 +118,13 @@
form.classList.add('was-validated')
}, false)
})
+
+ const password = document.getElementById("password")
+ const password_validation = document.getElementById("password-confirmation")
+ password.addEventListener('change', (c) => {
+ password_validation.setAttribute("pattern", c.target.value)
+ })
+
})()
{% endblock %}
\ No newline at end of file
diff --git a/app/utils/form_errors_dict.py b/app/utils/form_errors_dict.py
index aa2dde0..2d6f742 100644
--- a/app/utils/form_errors_dict.py
+++ b/app/utils/form_errors_dict.py
@@ -1,6 +1,7 @@
FORM_ERRORS = {
'REQUIRED': "This field is required.",
'PASSWORD_LENGTH': 'It must be at least 6 characters long.',
+ 'MUST_MATCH_PASSWORD': 'It must match the given password.',
'VALID_EMAIL': 'Enter a valid email address.',
'PHONE_NUMBER_FORMAT': 'It can be prefixed with the "+" sign and may only contain numbers after it.',
'NAME_FORMAT': 'It must be at least 2 characters long, it may only contain letters.'