Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

On-screen timer countdown

In follow-up to this automatic page submission post --

https://www.sawtoothsoftware.com/forum/5778/you-make-the-page-submit-automatically-after-timer-expires


I would like to know if there is a way to show an actual clock on a survey page which counts down in time with the functionality of this automatic page submission. The user sees something like "this page will advance in 15/14/13/12... seconds." with the numbers ticking down.

Any thoughts?
asked Apr 13 by WTW_cal Bronze (1,085 points)
retagged Apr 13 by Walter Williams

1 Answer

+1 vote
Try this code out:

This page will advance in <span id="countdown"></span>.

<script>
$(document).ready(function(){
    var time = 10;
    updateCountdown(time);
    setInterval(function(){
        time--;
        updateCountdown(time);
        if (!time) {
            SSI_SubmitMe();
        }
    }, 1000)
})

function updateCountdown(time) {
    $('#countdown').text(time + ' second' + (time != 1 ? 's' : ''));
}
</script>
answered Apr 13 by Zachary Platinum Sawtooth Software, Inc. (63,900 points)
...