Skip to content Skip to sidebar Skip to footer

Can't Make Datepicker Bootstrap To Work

I copy and paste the first example from this website http://eonasdan.github.io/bootstrap-datetimepicker/ to my own html codes. When I click on the picture beside the textbox, it do

Solution 1:

It seems like you are missing the Datepicker JavaScript library.

Include this and your datepicker should work.

Solution 2:

You haven't included any js. To make this work you should include bootstrap-datetimepicker.js and bootstrap.min.js

Solution 3:

Do you make use of Firebug? Do you get any errors? You might also have to include the jQuery library in order to make use of the $() function.

Solution 4:

Can you perhaps try the following code.

Very basic example that is working.

<!DOCTYPE html><html><head><title>Datepicker</title><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><!-- Bootstrap CSS and bootstrap datepicker CSS used for styling the demo pages--><linkrel="stylesheet"href="css/datepicker.css"><linkrel="stylesheet"href="css/bootstrap.css"></head><body><divclass="container"><inputtype="text"placeholder="Click to show datepicker"id="datetimepicker1"></div><!-- Load jQuery and bootstrap datepicker scripts --><scriptsrc="js/jquery-1.9.1.min.js"></script><scriptsrc="js/bootstrap-datepicker.js"></script><scripttype="text/javascript">// When the document is ready
            $(document).ready(function () {

                $('#example1').datepicker({
                    format: "dd/mm/yyyy"
                });  

            });
        </script></body></html>

Post a Comment for "Can't Make Datepicker Bootstrap To Work"