Hi Team,
I had a requirement like, need to validate OTP.
In that screen we need to bring timer. for that i had given below script and it is working fine too.
But once label reaches 0.00 it should trigger to contoller action.
Kindly let me know the possiblity.
<script>
var timer2 = "1:01";
var interval = setInterval(function () {
var timer = timer2.split(':');
//by parsing integer, I avoid all extra string processing
var minutes = parseInt(timer[0], 10);
var seconds = parseInt(timer[1], 10);
--seconds;
minutes = (seconds < 0) ? --minutes : minutes;
if (minutes < 0) clearInterval(interval);
seconds = (seconds < 0) ? 59 : seconds;
seconds = (seconds < 10) ? '0' + seconds : seconds;
//minutes = (minutes < 10) ? minutes : minutes;
$('.countdown').html(minutes + ':' + seconds);
timer2 = minutes + ':' + seconds;
}, 1000);
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="form-group">
OTP is valid till: <label id="lblcountdown" class="countdown"></label> @*<div id="divCountdown" class="countdown"></div>*@
</div>
Thanks in advance.