Dynadot โ€” .com Transfer

Javascript onsubmit 5 second countdown, Urgent!

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

clowesy

Established Member
Impact
13
Hey guys,
I have been looking for this code for ages with no success. Anyone who can provide me with a working code will get free access to the site this is being developed for. The site is revolutionary, so it is worth you while :)

Basically I need either a javacript which counts down from x seconds BEFORE showing the submit button

OR

a javascript that on clicking the submit button goes 5...,4...,3...,2...,1... before actually submitting.

Many Thanks
Tom
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
<html>
<script>

var i = 5;

function countdown()
{
if( i == 0 )
{
document.forms[0].submit();
}else{
document.forms[0].btnSubmit.value = i;
i--;
setTimeout("countdown()",1000);
}
}

</script>
<body>
<form action="http://www.google.com/" method="get">
<input type="button" name="btnSubmit" value="submit" onclick="countdown()">
</form>
</body>
</html>
 
0
•••
Maybe this will work for you with some editing?

<form name="redirect">
<center>
<font face="Arial"><b>You will be redirected to the script in<br><br>
<form>
<input type="text" size="3" name="redirect2">
</form>
seconds</b></font>
</center>

<script>
<!--

/*
Count down then redirect script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

//change below target URL to your own
var targetURL="http://javascriptkit.com"
//change the second to start counting down from
var countdownfrom=10


var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if (currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}

countredirect()
//-->
</script>
 
0
•••
-NC- That is perfect, exactly (well not exactly) what I was looking for. You will get free membership when I release the site. Many Thanks

briman, thanks for going to the effort. I will make sure you get something when the site is launched :)
 
0
•••
clowesy said:
-NC- That is perfect, exactly (well not exactly) what I was looking for. You will get free membership when I release the site. Many Thanks

briman, thanks for going to the effort. I will make sure you get something when the site is launched :)
Thanks Clowesy! :) Looking forward to seeing what your site is all about.
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back