0

Sarting from here I use the following html code:

<div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
  <input class="span2" size="16" type="text" value="12-02-2012">
  <span class="add-on"><i class="icon-th"></i></span>
</div>

near the end of body I call this:

<script src="../js/bootstrap-datepicker.js"></script>
<script>$('#dp3').datepicker(); </script>
  </body>

I also include the following

<link href="../css/datepicker.css" rel="stylesheet">

But when I click on the field no datepicker is open.

Adrift
  • 58,167
  • 12
  • 92
  • 90
GVillani82
  • 17,196
  • 30
  • 105
  • 172
  • 6
    Did you include the jQuery library as well? It's required for Bootstrap (and your current code) to work. Add `` right above the line where you include the datepicker library. – Ian Apr 22 '13 at 19:37
  • 1
    What does devtools say? Prob telling you the errors in the console when you click date picker. – rhinds Apr 22 '13 at 19:38
  • @lan, you are rights...I was referring to bad jquery library. Thank you. – GVillani82 Apr 22 '13 at 19:46

2 Answers2

2

As mentioned previously, make sure you are including jQuery, and also wrap your datepicker initialization in the jQuery ready() function, like so:

$(document).ready(function($) {
  $('#dp3').datepicker();
});

See it working here: http://jsfiddle.net/rUa7M/

jdub
  • 160
  • 1
  • 8
-1

Or

$(function() {
  $('#dp3').datepicker();
});
RelevantUsername
  • 1,270
  • 8
  • 14