Title: Counter based on input
Last modified: May 13, 2020

---

# Counter based on input

 *  Resolved [piotr1985](https://wordpress.org/support/users/piotr1985/)
 * (@piotr1985)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/counter-based-on-input/)
 * Is there a way to create a counter (top of the results page after you enter an
   email) similar to the example below?
    [https://www.zerto.com/page/downtime-calculator/#form-container](https://www.zerto.com/page/downtime-calculator/#form-container)
 * If there is a way to create a counter like that which uses a calculation to increase
   a live counter ever 1 second?
 * Styling is not an issue, just want to know if it’s possible.
 * Thanks!
    Piotr

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/counter-based-on-input/#post-12829401)
 * Hello [@piotr1985](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form - AI Form Builder for WordPress - Contact, Payment, Quote, Quiz & More](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/counter-based-on-input/#post-12829401)
 * Status: resolved