Fix password updation

This commit is contained in:
Anthony Stirling
2023-08-19 12:50:49 +01:00
parent 87ac245341
commit 505855a53c
2 changed files with 14 additions and 5 deletions

View File

@@ -155,7 +155,19 @@
}
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector('form[action="/change-password"]');
form.addEventListener('submit', function(event) {
const newPassword = document.getElementById('newPassword').value;
const confirmNewPassword = document.getElementById('confirmNewPassword').value;
if (newPassword !== confirmNewPassword) {
alert('New Password and Confirm New Password must match.');
event.preventDefault(); // Prevent form submission
}
});
});
</script>