Remove form
This commit is contained in:
parent
f6a5ec5a77
commit
65e327c83d
@ -44,7 +44,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form id="printTempPw" class="space-y-4 mt-12"></form>
|
|
||||||
<div>
|
<div>
|
||||||
<label for="password" class="block text-sm font-medium text-gray-700">Temp Password:</label>
|
<label for="password" class="block text-sm font-medium text-gray-700">Temp Password:</label>
|
||||||
<input type="text" id="password" name="password" required
|
<input type="text" id="password" name="password" required
|
||||||
@ -53,11 +52,11 @@
|
|||||||
|
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<button type="submit"
|
<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">
|
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
|
Print Temp Password
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -109,12 +108,8 @@
|
|||||||
.catch(error => alert('Error: ' + error));
|
.catch(error => alert('Error: ' + error));
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('printTempPw').addEventListener('submit', (event) => {
|
document.getElementById('printTempPw').addEventListener('click', (event) => {
|
||||||
event.preventDefault(); // Prevent the form from submitting normally
|
const password = document.getElementById('password').value;
|
||||||
|
|
||||||
// Get the form data
|
|
||||||
const formData = new FormData(event.target);
|
|
||||||
const password = formData.get('password');
|
|
||||||
|
|
||||||
// Send a POST request with the form data to the server
|
// Send a POST request with the form data to the server
|
||||||
fetch('/print-temp-pw', {
|
fetch('/print-temp-pw', {
|
||||||
|
Loading…
Reference in New Issue
Block a user