Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @piotr1985

    Create a counter is easy, you can insert a “HTML Content” field in the form with the following piece of code as its content:

    
    <div class="counter-here"></div>
    <script>
        var global_counter = 0;
        setInterval(function(){
            global_counter++;
            var h, m, s, t;
            h = Math.floor(global_counter/3600);
            t = global_counter%3600;
            m = Math.floor(t/60);
            s = t%60;
            h = (h<10) ? '0'+h:h;
            m = (m<10) ? '0'+m:m;
            s = (s<10) ? '0'+s:s;
            jQuery('.counter-here').html(h+':'+m+':'+s);
        }, 1000);
    </script>
    

    and that’s all.
    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Counter based on input’ is closed to new replies.