dcass
asked on
Timer - when 0 will display button to proceed.
I need an asp timer that will count down from 30 minutes onLoad and then at 0 seconds will display a button that will allow them to proceed. In other words, they cannot proceed to the next page until the 30 minute timer is up, therefore I don't want the Proceed button to appear until the timer hits 0. This should be a pretty simple proc for someone who knows javascript :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it!!!function ActionAfterWait() {
Stop();
alert('You may proceed to the next segment now!');
// I added this next line
document.getElementById('S ubmit').di sabled = false;
}
function Start() {
clearTimeout(timerID);
clearTimeout(totTimerID);
timerID = 0;
totTimerID = 0;
document.theTimer.theTime. value = "30:00";
totTimerID = setTimeout("ActionAfterWai t()", totDuration);
document.theTimer.theTime. value = "30:00";
timerID = setTimeout("UpdateTimer()" , 1000);
// and I added this line
document.getElementById('S ubmit').di sabled = 'disabled';
}
and this:
<input type=text name="theTime" size=3 readonly>
<INPUT TYPE="submit" id="submit" style="border:1px solid #000000; padding-top:2; padding-bottom:1" NAME=dest VALUE="Advance" onClick="document.forms[0] .action='A dvance.asp '" >
and it works exactly the way I want it to.
Thanks!!!
Stop();
alert('You may proceed to the next segment now!');
// I added this next line
document.getElementById('S
}
function Start() {
clearTimeout(timerID);
clearTimeout(totTimerID);
timerID = 0;
totTimerID = 0;
document.theTimer.theTime.
totTimerID = setTimeout("ActionAfterWai
document.theTimer.theTime.
timerID = setTimeout("UpdateTimer()"
// and I added this line
document.getElementById('S
}
and this:
<input type=text name="theTime" size=3 readonly>
<INPUT TYPE="submit" id="submit" style="border:1px solid #000000; padding-top:2; padding-bottom:1" NAME=dest VALUE="Advance" onClick="document.forms[0]
and it works exactly the way I want it to.
Thanks!!!
ASKER
Here is what I added, but it does not work. It shows the timer, which is great, but never shows the button. I've tried the timer as all kinds of field types, but can't get it to work.
<% if cstr(theTime) <> "0:0" then %>
<input type=text name="theTime" size=3 readonly>
<% else %>
<INPUT TYPE="submit" style="border:1px solid #000000; padding-top:2; padding-bottom:1" NAME=dest VALUE="Advance" onClick="document.forms[0]
<% end if %>
Help with this and it's all done!