I have the following problem and I have not been able to solve it. I have a bootstrap modal sale. Inside the one an input where the date picker is loaded. It works well, but when selecting a date, it is not loaded in the input. I have tried everything without positive results. here part of the code.
the modal sale is called through ajax:
$('#asigna-modal').on('show.bs.modal', function(e) {
var $modal = $(this),
idp = <?php echo $idped?>;
$.ajax({
cache: false,
type: 'POST',
url: 'ajax/asigna_ped.php',
data: {"dato" : idp},
success: function(data) {
$modal.find('.edit-content').html(data);
}
});
})
and inside ajax / assign_ped.php:
<input type="text" class="form-control" id="datePicker" placeholder="dd/mm/aaaa">
<span class="input-group-addon"><i class="icon-calender"></i></span>
and its corresponding function.
$(function () {
$('#datePicker').datepicker({
format: 'dd/mm/yyyy',
minDate: '+5d',
autoclose: 'true',
language: 'es',
daysOfWeekDisabled: [0, 6]
})
});
If someone has experienced the same thing or has managed to solve this problem, I would appreciate guidance on how to do it. It is worth mentioning that the libraries are inserted in the main file. as always, thank you very much everyone.