@@ -109,12 +108,8 @@
.catch(error => alert('Error: ' + error));
});
- document.getElementById('printTempPw').addEventListener('submit', (event) => {
- event.preventDefault(); // Prevent the form from submitting normally
-
- // Get the form data
- const formData = new FormData(event.target);
- const password = formData.get('password');
+ document.getElementById('printTempPw').addEventListener('click', (event) => {
+ const password = document.getElementById('password').value;
// Send a POST request with the form data to the server
fetch('/print-temp-pw', {