Here it is
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">
.off {
visibility: hidden;
} .on {
visibility: visible;
}
</style>
<script type="text/javascript">
window.onload = function() {
var timeInterval = 5; //Delay of showing the submit buttons in seconds. Set the delay that you want to use in your case.
if (typeof timeInterval === 'undefined' || parseInt(timeInterval) <= 0) {
timeInterval = 1
}
document.getElementById('timeinfo').innerHTML = timeInterval + " Seconds more to load the submit button";
var si = setInterval(function() {
if (timeInterval === 0) {
clearInterval(si);
} else {
--timeInterval;
if (timeInterval !== 0) {
document.getElementById('timeinfo').innerHTML = timeInterval + " Seconds more to load the submit button";
} else {
document.getElementById('timeinfo').className = 'off'; //Hiding the counter area.
}
}
}, 1000);
setTimeout(function() {
document.getElementById('submit').className = 'on';
}, timeInterval * 1000);
}
</script>
</head>
<body>
<div id="timeinfo">
</div>
<br/>
<form name="f" action="" method="get">
<label>
Name
</label>
<input type="text" name="fname" id="fname" />
<br/>
<input type="submit" name="submit" id="submit" value="submit" class="off"/>
</form>
</body>
</html>
Hope this helps.
Bookmarks