Click to See Complete Forum and Search --> : Delayed Button Help!!
raven2424
06-28-2004, 02:41 PM
Hey guys any help would be great...
Here is what im trying to do i have a button on my webpage that says Enter but u cant click it for like X amount of seconds and after the time is up it becomes clickable. I know you can do this because i had it done b4 but i cant remember how :eek: so im sure someone here will know how thanks in advance ~Josh~
Bhanu
06-28-2004, 03:26 PM
ok
is this you r lloking for
Bhanu
<html>
<head>
<title>bhanu</title>
</head>
<script language="JavaScript">
counter=10
function timerdis()
{
counter--;
if(counter>0)
{setTimeout("timerdis()",1000);
document.forms[0].sb.disabled=true;}
else
{document.forms[0].sb.disabled=false;}
}
setTimeout("timerdis()",1000)
</script>
<body >
<form id="fm"onload="timerdis()">
<input type="Submit" id="sb" value="Enter" disabled >
</form>
</body>
</html>
raven2424
06-28-2004, 03:53 PM
ok the button is working but were to i include the link to were i want it to point two?
Bhanu
06-28-2004, 04:07 PM
I do not understand what your requirement is ?
can you give clear and more details?
thanks
Bhanu
theBody44
06-28-2004, 04:11 PM
<form id="fm"onload="timerdis()" method="post" action="//Where you are going.html">
vwphillips
06-28-2004, 04:28 PM
<html>
<head>
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
</head>
<body>
one of many solutions
<br>
I have not used the PHP tags as my posted code sometimes has a space inserted between Java and Script, you may have to edit this space out
<input type="button" id="vic" value="clickme" onclick="javascript:doit();">
<div class=debug>
<form name="Show">
<input type="text" size="20" name="Show1" value="Click 'Click Me' to Start" >
</form>
</div>
<script language="JavaScript" type="text/javascript">
<!--
Cnt=0;
function timer(){
Cnt++;
document.Show.Show1.value='Please Wait '+Cnt;
if (Cnt<100){setTimeout('timer()',100); } else { document.Show.Show1.value='Ready'; }
}
function doit(){
if (Cnt>99){
window.top.location="http://vicsjavascripts.org.uk"
}
else if (!Cnt){
setTimeout('timer()',1000);
document.Show.Show1.value='Please Wait';
}
}
<!---->
</script>
</body>
</html>
raven2424
06-28-2004, 05:22 PM
Ok thanks everyone it is now working :D weeeee!