Automatic Form Submission

Run this CODE… (and take a closer look into —> CONSOLE.

Try to understand all steps! Expand the code for your own needs, adding further functions and features to it.

$w.onReady(function () {
    var countDownDate = new Date().getTime() + (5000); 
    var x = setInterval(function () {

        var now = new Date().getTime();
        var distance = countDownDate - now;
        var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
        var seconds = Math.floor((distance % (1000 * 60)) / 1000);

        console.log( minutes + "m " + seconds + "s ");

        if (distance < 0) {clearInterval(x); console.log("COUNTER-STOPPED!!!");
            console.log("START YOUR FUNCTION HERE!!!!");
            myFunction()
        }
        else {console.log("COUNTER still running...");}
    }, 1000);

});

function myFunction(params) {
    console.log("NOW SOMETHING STARTED AUTOMATICALY AFTER THE COUNTER WAS DOWN!!!");
    console.log("GENERATE WHAT EVER YOU WANT HERE!!!"); 
}

READ THIS POST ADDITIONALY…
community.wix.com
[SOLVED] How to query a date field and show with a lamp if it isn´t empty? | Velo by WixI have tried for days now to make this work but still fail so please have a loo