Issue
I have the following date input:
<div class="form-group">
<label for="start_date">Start Date</label>
<input type="date" class="form-control" name="start_date" id="start_date" placeholder="mm/dd/yyyy">
</div>
If I click on it in chrome, a date picker pops up:
However, if I click it in firefox, the datepicker does not pop up:
Does anyone know why this is happening and/or how I can fix it in firefox so it is consistent?
Note - I am using bootstrap 3
Thanks in advance!!
Solution
EDIT as others have mentioned
input type="date" is now supported in FireFox
Unfortunately <input type="date"/>
is not supported in firefox. To be able to use date type in all browser you can check using modernizer and if not supported you can fall back to use javascript to show the datepickerr.
<script>
$(function(){
if (!Modernizr.inputtypes.date) {
$('input[type=date]').datepicker({
dateFormat : 'yy-mm-dd'
}
);
}
});
</script>
Answered By - riteshmeher
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.