I have an input type of date that works in all browsers (HTML5 for Chrome, and some javascript to make it work in IE11 and Firefox).
<input type="date" name="Date" id="Date" min="2016-10-19" max="2016-11-03"/>
But a weird thing is happening. If I select a date in Chrome it gets posted to my database, but if I select a date in IE11 or Firefox, it gets rejected as an invalid format.
My Scripts are currently inside the HTML, which is why it looks like this:
<script type="text/javascript">
var datefield=document.createElement("input")
datefield.setAttribute("type", "date")
if (datefield.type!="date"){ //if browser doesn't support input type="date", load files for jQuery UI Date Picker
document.write('<link href="css/jquery-ui.css" rel="stylesheet" type="text/css" />\n')
document.write('<script src="scripts/jquery.min.js"><\/script>\n')
document.write('<script src="scripts/jquery-ui.min.js"><\/script>\n')
}
</script>
<script type="text/javascript">
if (datefield.type!="date"){ //if browser doesn't support input type="date", initialize date picker widget:
jQuery(function($){ //on document.ready
$('#Date').datepicker({
showOtherMonths: true,
selectOtherMonths: true,
changeMonth: true,
minDate: '10/19/2016',
maxDate: '11/03/2016',
});
})
}
</script>