Forum Moderators: coopster
<script>
document.addEventListener("DOMContentLoaded", function() {
var startTime = Math.floor(Date.now() / 1000); // Record the time when the form loads in seconds
document.getElementById("submit").addEventListener("click", function(event) {
var currentTime = Math.floor(Date.now() / 1000); // Get the current time in seconds
var elapsedTime = currentTime - startTime; // Calculate the elapsed time in seconds
if (elapsedTime < 5) {
event.preventDefault(); // Prevent form submission
var remainingTime = 5 - elapsedTime; // Calculate remaining time
remainingTime = padWithZeroes(remainingTime); // Format remaining time to two digits
alert("Slow mode enabled: Please wait at least 5 seconds before submitting the form. Time remaining: " + remainingTime + " seconds");
}
});
// Function to pad a number with leading zeroes if needed
function padWithZeroes(num) {
var numStr = num.toString();
return numStr.length < 2 ? '0' + numStr : numStr;
}
});
</script>
I need to figure it out.. the ChatGpt already write the code for me.
use a captcha or simply reject all submissions that contain a url.