i have a modal, in modal i have a form, in the form i have date input element. I want to use Bootstrap 3 Datepicker, but i don't work.
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Large modal</button>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<input type='text' class="form-control" id='datetimepicker4' />
</div>
</div>
then my script
<script type="text/javascript">
$(function () {
$('#datetimepicker4').datetimepicker({
format: 'DD-MM-YYYY',
locale: 'it'
});
The think most strange is that, when i click on input, i get today date, but i can't see the datepicker.
Please view the answers in this post: IE not rendering DatePicker for MVC5
They are using: @Html.TextBoxFor
As per my research, the input type doesnt have full support of HTML5 in IE browser.
My working code:- Index.cshtml
And then the Create page has.
For me I am unable to choose any date on the datepicker but for most of the people it seem to work. Everything works fine with the inbuilt date picker using this annotation in Model [DataType(DataType.Date)] in Chrome and Mozilla. Hope this helps.