Pages

Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Javascript : Auto submit form after timer/countdown in Javascript / html

how to form submit on timer/countdown you can pass time through in javascript CountDown(5,div); function, example 10 second pass CountDown(10,div);


 Let's create a index.php file.


 <html>
<body>
    <form action="" method="post" name="MCQuestion" id="MCQuestion">
    Name:<input type="test" name="name" value="ABC">
    <div><span id="display" style="color:#FF0000;font-size:15px"></span></div>
<div><span id="submitted" style="color:#FF0000;font-size:15px"></span></div>
</form>
<script>
var div = document.getElementById('display');
var submitted = document.getElementById('submitted');

    function CountDown(duration, display) {

            var timer = duration, minutes, seconds;

            var interVal=  setInterval(function () {
                minutes = parseInt(timer / 60, 10);
                seconds = parseInt(timer % 60, 10);

                minutes = minutes < 10 ? "0" + minutes : minutes;
                seconds = seconds < 10 ? "0" + seconds : seconds;
        display.innerHTML ="<b>" + minutes + "m : " + seconds + "s" + "</b>";
                if (timer > 0) {
                    --timer;
                }else{
            clearInterval(interVal)
                    SubmitFunction();
                    }

            },1000);

    }

    function SubmitFunction(){
    submitted.innerHTML="Time is up!";
    document.getElementById('MCQuestion').submit();

    }
    CountDown(5,div);
</script>
</body>
</html>

Embed YouTube Videos

We can embed YouTube videos to your web site by using either the iframe or object HTML tags.

Based on the information from https://www.youtube.com/yt/dev/

Use the youtube site to find the video you want

Click the 'Share' button below the video

Copy the iframe code given and paste it into the html of your web page.

Click the 'Embed' button next to the link they show you


Example:

Video: How to display records using database in php using codeigniter framework

https://www.youtube.com/watch?v=5TvbzlE2Xcw


How to display records using database in php using codeigniter framework ?


This tutorial is intended to introduce you to the CodeIgniter framework and the basic principles of MVC architecture. It will show you how a basic CodeIgniter application is constructed in step-by-step fashion.

Popular Posts