In my project i am using jquery datepicker.It works well in all pages but it's not working in bootstrap modal window.Below is my code for loading datepicker.
$("#StartDate").datepicker({
changeMonth : true,
changeYear : true,
dateFormat : "yy-mm-dd",
});
Now, I cannot able to change month and year from datepicker dropdown. How to fix this issue?Any help will be greatly appreciated!!!
While searching more on it, I found it is already answered in another StackOverflow post. Here is some working code, taken from there:
var enforceModalFocusFn = $.fn.modal.Constructor.prototype.enforceFocus;
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
Try this.
Why aren't you using bootstrap datepicker?
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With