a
This commit is contained in:
@@ -120,7 +120,7 @@
|
||||
<div class="modal fade" id="editModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark text-white">
|
||||
<form method="post" action="/edit">
|
||||
<form method="post" action="/submit">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Modifier l'élément</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
@@ -132,15 +132,12 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nom</label>
|
||||
<input type="text" class="form-control" name="name" id="editName">
|
||||
<input type="text" class="form-control" name="query" id="editName">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">No Shutdown</label>
|
||||
<select class="form-select" name="noshutdown" id="editNoshutdown">
|
||||
<option value="1">OUI</option>
|
||||
<option value="0">NON</option>
|
||||
</select>
|
||||
<input class="form-check-input" type="checkbox" name="noshutdown" id="editNoshutdown">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@@ -187,21 +184,14 @@ document.querySelectorAll('.edit-btn').forEach(button => {
|
||||
|
||||
document.getElementById('editOriginalName').value = name;
|
||||
document.getElementById('editName').value = name;
|
||||
document.getElementById('editNoshutdown').value = noshutdown;
|
||||
document.getElementById('editNoshutdown').checked = noshutdown;
|
||||
document.getElementById('editTime').value = time;
|
||||
const timeSelect = document.getElementById('editTime');
|
||||
const noshutdownSelect = document.getElementById('editNoshutdown');
|
||||
|
||||
timeSelect.disabled = (noshutdown == "1");
|
||||
timeSelect.disabled = noshutdownSelect.checked;
|
||||
noshutdownSelect.addEventListener('change', function () {
|
||||
if (this.value == "1")
|
||||
{
|
||||
timeSelect.disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
timeSelect.disabled = false;
|
||||
}
|
||||
timeSelect.disabled = this.checked;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user