diff --git a/website/index.php b/website/index.php index a82369fc..c5a39bbf 100644 --- a/website/index.php +++ b/website/index.php @@ -154,8 +154,7 @@ if (isset($_SESSION['steamid'])) {
- - 0 +
@@ -173,9 +172,19 @@ if (isset($_SESSION['steamid'])) { document.getElementById('wearValue').innerText = this.value; }); // seed - document.getElementById('seed').addEventListener('input', function () { - document.getElementById('seedValue').innerText = this.value; - }); + function validateSeed(input) { + // Check entered value + var inputValue = input.value.replace(/[^0-9]/g, ''); // Just get the numbers + + if (inputValue === "") { + input.value = 0; // Set to 0 if empty or no numbers + } else { + var numericValue = parseInt(inputValue); + numericValue = Math.min(1000, Math.max(1, numericValue)); // Interval control + + input.value = numericValue; + } + }