How to Get HTML 5 Input Type="Date" Working in Firefox And/Or Ie 10

Date input not working 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>

input type=date then datepicker Icon is not appearing on Firefox

I'm able to resolve datepicker icon disappear in input textbox when we use input type="date". It works in Chrome, Firefox, Edge.
Below are the css I have used and applied those on divs

 .cal-wrp {
position: relative;
background-color: white;
margin-bottom: 16px;
}

.btnCal-wrp {
display: inline-block;
width: 100%;
position: relative;
z-index: 10;
}

.btnCal-click {
border: 0.0625rem solid #cfd0d3;
background-color: transparent;
width: 100%;
padding: 0.75rem;
cursor: pointer;
border-radius: 0;
font-size: 0.875rem;
line-height: 1.4;
}

.btnCal-click::-webkit-calendar-picker-indicator {
right: -10px;
position: absolute;
width: 78px;
height: 40px;
color: rgba(204, 204, 204, 0);
opacity: 0;
}

.btnCal-click::-webkit-inner-spin-button {
-webkit-appearance: none;
}

.btnCal-click::-webkit-clear-button {
margin-right: 75px;
}

.btnCal {
background: transparent;
border: none;
color: black;
padding: 13px;
position: absolute;
right: 0;
top: 0;
}

Calendar textbox code:

<div class="cal-wrp">
<div class="btnCal-wrp">
<input class="btnCal-click" type="date" required>
</div>
<button class="btnCal"><span class="fa fa-calendar"></span></button>
</div>

How to make input type=date supported on all browsers? Any alternatives?

Any browser that does not support the input type date will default to the standard type, which is text, so all you have to do is check the type property (not the attribute), if it's not date, the date input is not supported by the browser, and you add your own datepicker:

if ( $('[type="date"]').prop('type') != 'date' ) {
$('[type="date"]').datepicker();
}

FIDDLE

You can of course use any datepicker you want, jQuery UI's datepicker is probably the one most commonly used, but it does add quite a bit of javascript if you're not using the UI library for anything else, but there are hundreds of alternative datepickers to choose from.

The type attribute never changes, the browser will only fall back to the default text type for the property, so one has to check the property.

The attribute can still be used as a selector, as in the example above.

How to remove cross on date and time HTML inputs in Firefox

I've done some research and found nothing so far. The best Solution I could come up with would be to clip the icon outside the input field and removing the border so it wouldn't look that bad. Here's what I mean:

input[type="time"]{  width:120px;  border: none;  clip-path: inset(0 17px 0 0);  outline:none;  outline:0;}
<input type="time" required/>

Datepicker Support in IE11 and Firefox

Internet Explorer 11 does not currently support <input type='date'>, though we did recently announce that work was underway to do so. You can track that progress online at http://status.modern.ie.

Firefox supports <input type='date'>. The bug requesting support was closed on June 22, 2016

If you need this functionality today, I would encourage you to use jQuery's Datepicker.



Related Topics



Leave a reply



Submit