Open on calendar icon only
The old datepicker opened when clicking the calendar icon, but this opens on input field focus.
How do I change it to open only on calendar icon click?
Had similar "issue" today. Later I figured out that the problem was actually in my code, creating .datepicker() directly form the <input> element rather than from the surrounding <div>.
See this sandbox example.
Closing for #377
Same issue I suffering... I want to open calender on click icon not on clicking input box. how to do this?
@eternicode I'm having this same issue, and am not sure if #377 solved it or if the fix is still in the works... I'm using the "showOnFocus" method (set to False- have tried in both JS and HTML), but rather than only focusing when clicking the calendar icon, it eliminates focus on everything. Am I using the method incorrectly? Code sample below.
HTML:
<div class="input-group date">
<input id="date" type="text" maxlength="14" class="form-control our-date-picker" data-provide="our-date-picker" data-date-autoclose="true" data-date-toggle-active="true" data-date-show-on-focus="false"/>
<span class="input-group-addon">
<i class="fa fa-calendar"></i>
</span>
</div>
Javascript:
$('#sandbox-container input').datepicker({
orientation: "top right",
showOnFocus: "false"
});
this is working for me
$(function () {
$("#datepicker").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "dd/mm/yy"
}).datepicker("setDate", new Date());
$('#btnPicker').click(function () {
//alert('clicked');
$('#datepicker').datepicker('show');
});
});