40
Views
8
Comments
Solved
Timer
Question
Application Type
Mobile

Hi, I have a button to resendOTP  I want to show timer for one minute and once one minute passed then show the button with text [RESEND OTP]. I want to show the button after 1 minutes. So I need countdown timer using Jquery or javascript. Please help me on this task. thanks in advance. [mobile app] in outsystem 

2019-11-11 17-10-24
Manish Jawla
 
MVP
Solution

Hi @Prasanth S ,

I have created a forge component for this problem, because I believe other might also need such kind of functionality in future.

https://www.outsystems.com/forge/component-overview/21967/loading-button-with-timer-o11 

Please have a look.

Hope this helps.

Regards,

Manish Jawla

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi @Prasanth S ,

You can check this component: CountDown Timer Reactive Library

UserImage.jpg
Prasanth S

"$('#"+ResendOTP.Id+"').hide()$('#"+Second.Id+"').show()$('#"+Countdown.Id+"').hide()var newInterval= 60;$('#"+Countdown2.Id+"').show()setInterval(function(){if(newInterval>1){newInterval=newInterval-0;}else{$('#"+ResendOTP.Id+"').show()$('#"+Countdown2.Id+"').hide()$('#"+Second.Id+"').hide()}$('#"+Countdown2.Id+"').text(newInterval)},1000)"



this java script working traditional web  lithis i want mobile app 


2026-03-04 12-08-39
Luiz Henrique Stanqueviski

Hi @Prasanth S

When the user clicks the button for the first time, change its visibility through a client variable to false and execute a javascript SetTimeout with 600ms calling a function that changes the button's visibility again, setting the client variable to True.

2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi @Prasanth S ,

Can you try the below JavaScript on your button action:

function startResendOtpTimer() {

    var button = document.getElementById("resendOtpButton");//button id

    var timerLabel = document.getElementById("timerLabel");// your timer label id

    var countdown = 60;


    // Initially hide the button and show the countdown

    button.style.display = "none";

    timerLabel.style.display = "block";


    var interval = setInterval(function () {

        timerLabel.innerText = "You can resend OTP in " + countdown + "s";

        countdown--;


        if (countdown < 0) {

            clearInterval(interval);

            timerLabel.style.display = "none";

            button.innerText = "RESEND OTP";

            button.style.display = "block";

        }

    }, 1000);

}

Hope this helps,

Regards,

Manish Jawla

2025-08-07 06-30-56
Amit J
Champion

Hi 
you can create a client function and add the below code to JS node and call that function after send OTP action


$(document).ready(function(){

  varcounter=60;varinterval=setInterval(function(){

    if(counter>0){

      $('#" +$parameters.CountdownText_ID + "').text('Resend available in '+counter+'s');counter--;

    }else{

      clearInterval(interval);
$('#" + $parameters.CountdownText_ID + "').hide();
$('#" + $parameters.ResendOTPButton_ID + "').show();

    }

  },

  1000);

});

UserImage.jpg
Prasanth S

can u send any oml file for my reference

2025-08-07 06-30-56
Amit J
Champion
2019-11-11 17-10-24
Manish Jawla
 
MVP
Solution

Hi @Prasanth S ,

I have created a forge component for this problem, because I believe other might also need such kind of functionality in future.

https://www.outsystems.com/forge/component-overview/21967/loading-button-with-timer-o11 

Please have a look.

Hope this helps.

Regards,

Manish Jawla

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.