Remove form

This commit is contained in:
Skylar Grant 2024-09-12 12:32:59 -04:00
parent f6a5ec5a77
commit 65e327c83d
1 changed files with 14 additions and 19 deletions

View File

@ -44,20 +44,19 @@
</div>
</form>
<form id="printTempPw" class="space-y-4 mt-12"></form>
<div>
<label for="password" class="block text-sm font-medium text-gray-700">Temp Password:</label>
<input type="text" id="password" name="password" required
class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700">Temp Password:</label>
<input type="text" id="password" name="password" required
class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
</div>
<div class="text-center">
<button type="submit"
class="w-full bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 mt-2">
Print Temp Password
</button>
</div>
</form>
<div class="text-center">
<button type="submit"
id="printTempPw"
class="w-full bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 mt-2">
Print Temp Password
</button>
</div>
</div>
@ -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', {