• February 7, 2024
    <button onclick="submitForm()">Submit Form</button>
    <script>
    // Setup variable for easy tracking!!!
    var timesSubmitted = 0, timeCounter = 60 * 1000, Timer = null;
    
    // Call function to submit form
    function submitForm() {
        // Check if user has submitted form more than 1 times
        if (timesSubmitted < 1) {
            // If timer has yet to be started... Start it! 
            if (Timer === null) {
                Timer = setTimeout(
                    function() {  
                        // Setup alert so user knows they can continue to submit form
                        if (timesSubmitted > 0) { alert('Submissions Reset'); }
                        timesSubmitted = 0; 
                    }, 
                timeCounter );
            }
            
            // Add for submission to counter
            timesSubmitted++;
        }else{
            // Alert user they can not sumbit anymore!
            alert('You may only submit this from 1 times per minute!');
        }
    }
    </script>


เวอไนน์ไอคอร์ส

ประหยัดเวลากว่า 100 เท่า!






เวอไนน์เว็บไซต์⚡️
สร้างเว็บไซต์ ดูแลเว็บไซต์

Categories