My question is probably simple, but I'm only a week into programming, and I cant really understand the relative answers that I could find. So... need your Jedi help. How to disable a submit button for 10 seconds after the page is loaded? Thanks!
You can use javascript like this
<input type="submit" id="submitButton" disabled="disabled" />
using
<script type="text/javascript">
window.onload=function() {
setTimeout(function(){
document.getElementById('submitButton').disabled = null;
},10000);
}
</script>
The following will additionally show a countdown in a container with ID="timeLeft" if you need one
<script type="text/javascript">
var countdownNum = 10;
window.onload=function() {
incTimer();
}
function incTimer(){
setTimeout (function(){
if(countdownNum != 0){
countdownNum--;
document.getElementById('timeLeft').innerHTML = 'Time left: ' + countdownNum + ' seconds';
incTimer();
} else {
document.getElementById('submitButton').disabled = null;
document.getElementById('timeLeft').innerHTML = 'Ready!';
}
},1000);
}
</script>