I have been trying to incorporate a calendar control in my code that selects a date and returns it to a text field. It worked perfectly fine on browsers prior to IE 8, but I'm facing issues with IE 9. Can someone help me troubleshoot this problem and make the calendar control compatible with IE 9 or 10?
Message from F12 Developer Tools Console:
HTML1113: Document mode restarts from IE9 Standards to Quirks
Additionally:
SCRIPT438: Object doesn't support this property or method: 'document.all.calendar1.value'
<head>
<title>SELECT A DATE</title>
<!--<meta http-equiv="X-UA-Compatible" content="IE=8" />-->
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV="expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
</head>
<BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 bgcolor=#cccac0>
<SCRIPT LANGUAGE=VBSCRIPT>
Sub window_onunload
window.returnvalue = formatdatetime(document.all.Calendar1.value,2)
end sub
</SCRIPT>
<!--<SCRIPT LANGUAGE=VBSCRIPT>
Sub window_onunload
window.returnvalue = formatdatetime(document.getElementById("Calendar1"))
end sub
</SCRIPT>-->
<OBJECT id="Calendar1" style="LEFT: 0px; WIDTH: 289px; TOP: 0px; HEIGHT: 198px"
classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" width=289 height=198 VIEWASTEXT class="Calendar">
<PARAM NAME="_Version" VALUE="524288">
<PARAM NAME="_ExtentX" VALUE="7646">
<PARAM NAME="_ExtentY" VALUE="5239">
<PARAM NAME="_StockProps" VALUE="1">
<PARAM NAME="BackColor" VALUE="-2147483633">
<PARAM NAME="Year" VALUE="<%=year(now())%>">
<PARAM NAME="Month" VALUE="<%=month(now())%>">
<PARAM NAME="Day" VALUE="<%=day(now())%>">
<PARAM NAME="DayLength" VALUE="1">
<PARAM NAME="MonthLength" VALUE="2">
<PARAM NAME="DayFontColor" VALUE="0">
<PARAM NAME="FirstDay" VALUE="1">
<PARAM NAME="GridCellEffect" VALUE="1">
<PARAM NAME="GridFontColor" VALUE="10485760">
<PARAM NAME="GridLinesColor" VALUE="-2147483632">
<PARAM NAME="ShowDateSelectors" VALUE="-1">
<PARAM NAME="ShowDays" VALUE="-1">
<PARAM NAME="ShowHorizontalGrid" VALUE="-1">
<PARAM NAME="ShowTitle" VALUE="-1">
<PARAM NAME="ShowVerticalGrid" VALUE="-1">
<PARAM NAME="TitleFontColor" VALUE="10485760">
<PARAM NAME="ValueIsNull" VALUE="0">
</OBJECT>
<BR>
<center><!-- <INPUT type=button value="Select Date" onClick=window.close></center> -->
<img src="selectadate.png" alt="Select a Date" onClick=window.close>
</BODY>