Featured Posts

Submit otomatis php

<html>
<head></head>
<body>

<div><h4><strong id="count"></strong></h4></div>//menampilkan waktu mundur submit dimulai dari 02:59 sampai 00:00
//----------------------------------------------------------

<form action="<?=base_url()?>index.php/controller/view" method="post" name="form1" id="form1">
//form submit
</form>
//-----------------------------------------------------------
<script>
        var clock = document.getElementById("countdown-holder")
            , targetDate = new Date(2050, 00, 01); // Jan 1, 2050;
        clock.innerHTML = countdown(targetDate).toString();
        setInterval(function(){
            clock.innerHTML = countdown(targetDate).toString();
        }, 1000);
    </script>
    <script type="text/javascript">
        function countdown(minutes) {
            var seconds = 60;
            var mins = minutes
            function tick() {
                var counter = document.getElementById("count");
                var current_minutes = mins-1
                seconds--;
                counter.innerHTML = (current_minutes < 10 ? "0" : (current_minutes == 0 ? "00" : "")) + current_minutes.toString() + " : " + (seconds < 10 ? "0" : "") + String(seconds);
                if( seconds > 0 ) {
                    setTimeout(tick, 1000);
                } else {
                    if(mins > 1){
                        setTimeout(function () { countdown(mins - 1); }, 1000);
                    }
                }
            }
            tick();
        }
        countdown(3);//hitungan dalam menit
    </script>

</body>
</html>


"cocok untuk halaman yang mempunyai satu tombol submit saja"
semoga membantu :D

Belum ada Komentar untuk "Submit otomatis php"

Posting Komentar

Pages

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel