hidrau
asked on
How can I create a timer that can be displayed in my form?
Hello guys
I'd like to have a timer that could be displayed in my form, this timer will be from 1 minute to 0
I will use this to show the user how many minutes it has before the page be reload.
is there any way to do this in Javascript or Jquery?
thanks
I'd like to have a timer that could be displayed in my form, this timer will be from 1 minute to 0
I will use this to show the user how many minutes it has before the page be reload.
is there any way to do this in Javascript or Jquery?
thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks very much
ASKER
just one thing,
if I have 420 seconds that is 7 minutes, how can I format my seconds in minutes and seconds lapsed?
if I have 420 seconds that is 7 minutes, how can I format my seconds in minutes and seconds lapsed?
For example :
var secondsLeft = 420;
window.onload = setInterval("updateTimer()", 1000);
function updateTimer() {
var h = document.createElement("h3");
var s = secondsLeft%60;
var m = parseInt(secondsLeft/60);
h.innerHTML = m + "min" + s + "s";
if(secondsLeft--<0) {
location.href = "http://www.experts-exchange.com/Programming/Languages/Scripting/JScript/Q_26985174.html";
}
else {
document.getElementById("timer").innerHTML = "";
document.getElementById("timer").appendChild(h);
}
}
Thanks for the points!
nice - my solution is the assisted one?
sorry but @leakim971 and your's solution is not working because of: <script type="application/javascri pt"> - which is not correct.
here is a solution with minutes: http://javascript.internet.com/time-date/countdown-timer-2.html
sorry but @leakim971 and your's solution is not working because of: <script type="application/javascri
here is a solution with minutes: http://javascript.internet.com/time-date/countdown-timer-2.html
@roma1123 is right on IE it don't work, just remove the type attribute or replace it with : text/javascript
ASKER
but I am not being able to start the code
Open in new window