Skip to content

Commit

Permalink
Password validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby committed Oct 8, 2024
1 parent 986b545 commit 5b81777
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions application/src/main/resources/templates/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,23 @@ <h1 class="form-title" th:text="#{title}"></h1>

<div th:replace="~{gateway_modules/common_fragments::languageSwitcher}"></div>
</div>

<script th:inline="javascript">
document.addEventListener("DOMContentLoaded", function () {
var password = document.getElementById("password"),
confirm_password = document.getElementById("confirmPassword");
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;
});
</script>
</th:block>
</html>

0 comments on commit 5b81777

Please sign in to comment.