Marilee Marilee - 1 year ago 130
HTML Question

Bootstrap Date Time Picker No Response

I have followed the example given at to the letter.

Im trying to do disabling dates in the past and dependent disabling.

You can view my JSFIDDLE here.

This is my head:

<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="datepicker/css/datepicker.css">
<script src=""></script>
<script src=""></script>
<script src="datepicker/js/bootstrap-datepicker.js"></script>

Below Is my Code as per the example:

var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);

var checkin = $('#dpd1').datepicker({
onRender: function(date) {
return date.valueOf() < now.valueOf() ? 'disabled' : '';
}).on('changeDate', function(ev) {
if ( > {
var newDate = new Date(
newDate.setDate(newDate.getDate() + 1);
var checkout = $('#dpd2').datepicker({
onRender: function(date) {
return date.valueOf() <= ? 'disabled' : '';
}).on('changeDate', function(ev) {

<input type="text" id="dpd1" value="" class="span2">
<input type="text" id="dpd2" value="" class="span2">

My problem...Well the browser, neither firefox - firebug or chrome are displaying any errors, however when I click on text field it is unresponsive i.e. nothing happens. I can confirm datepicker.js & css are linked correctly as verified by dreamweaver.

Not really sure what I am missing here, perhaps I didn't get something in the tutorial, if anyone could give this a quick scan would be greatly appreciated.

Answer Source

You never called datepicker

$(document).ready(function() { $('.datepicker').datepicker() //now do your stuff var nowTemp = new Date(); : :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download