When I try to have 2 datepickers only the first one pops up.
The other one doesn’t
I uploaded the code to
http://jsfiddle.net/2ed8T/
<link href="http://aymkdn.github.com/Datepicker-for-Bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="http://github-proxy.kodono.info/?q=https://raw.github.com/Aymkdn/Datepicker-for-Bootstrap/master/datepicker.css" rel="stylesheet">
<div class="input-append date" id="dp2" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
<input class="span2" name="date_to" size="16" type="text" value="12-02-2012" readonly>
<span class="add-on"><i class="icon-th"></i></span>
</div>
<div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
<input class="span2" name="date_to" size="16" type="text" value="12-02-2012" readonly>
<span class="add-on"><i class="icon-th"></i></span>
</div>
<script src="http://aymkdn.github.com/Datepicker-for-Bootstrap/js/jquery-1.7.1.min.js"></script>
<script src="http://github-proxy.kodono.info/?q=https://raw.github.com/Aymkdn/Datepicker-for-Bootstrap/master/bootstrap-datepicker.js"></script>
<script>
$(function(){
$('#dp2').datepicker()({
format: 'mm-dd-yyyy'
});
$('#dp3').datepicker()({
format: 'mm-dd-yyyy'
});
});
</script>
You have an extra set of parenthesis in your
.datepicker()calls.Instead of
$('#dp2').datepicker()({...}), it should be$('#dp2').datepicker({...})