diff --git a/public/script.js b/public/script.js index 1b9d78a..5a2024b 100644 --- a/public/script.js +++ b/public/script.js @@ -50,16 +50,16 @@ document.addEventListener("DOMContentLoaded", () => { const totalCell = document.createElement("td"); totalCell.textContent = "0.00 €"; - // Bouton Option + // Radio Option const optionCell = document.createElement("td"); - const optionButton = document.createElement("button"); - optionButton.textContent = "Option"; - optionButton.addEventListener("click", () => { + const radioInput = document.createElement("input"); + radioInput.type = "radio"; + radioInput.addEventListener("change", () => { const montant = parseFloat(montantInput.value || "0"); - montantInput.value = montant > 0 ? -montant : Math.abs(montant); + montantInput.value = radioInput.checked ? -Math.abs(montant) : Math.abs(montant); updateRowTotal(); }); - optionCell.appendChild(optionButton); + optionCell.appendChild(radioInput); // Calculer le total de la ligne const updateRowTotal = () => { diff --git a/public/style.css b/public/style.css index 4c69a67..f0cbae0 100644 --- a/public/style.css +++ b/public/style.css @@ -42,7 +42,7 @@ body { right: 15px; z-index: 2000; padding: 10px 22px; - background-color: #007bff; /* Bleu */ + background-color: #007bff; color: white; border: none; border-radius: 5px; @@ -89,20 +89,14 @@ body { width: 25%; } -#articles-table td input { +#articles-table td input, +#articles-table td select { padding: 5px; - width: 90%; font-size: 16px; } -#articles-table td button { - background-color: #ffc107; - border: none; - border-radius: 5px; - color: white; +#articles-table td input[type="radio"] { cursor: pointer; - padding: 5px 10px; - font-size: 14px; } #articles-table tbody tr:nth-child(even) {