Answer the question
In order to leave comments, you need to log in
Datepicker not working (Bootstrap)?
It is necessary to display in the input field - a calendar (datepicker (Bootstrap)).
The problem is that in the first case it is displayed:
<input type="text" class="datepicker_goal" data-provide="datepicker" value="Period">
$('.modal-body input[data-provide="datepicker"]').datepicker();
<input type="text" class="datepicker_goal_modal" data-provide="datepicker_modal" value="Period">
$('.modal-body input[data-provide="datepicker_modal"]').datepicker();
Answer the question
In order to leave comments, you need to log in
Try this
<input type="text" class="datepicker_goal" data-provide="datepicker" value="Period">
$('.modal-body input').datepicker();
Hang the initialization of the datepicker on the appearance event of the modal window.
$('#myModal').on('show.bs.modal', function (e) {
if (!data) return e.preventDefault() // stops modal from being shown
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question