M
meg
I have a calendar control on my webpage, when I run it in preview it works, when i run it in IE I get the
error "Calendar1 is undefined". Can someone help me figure out how to correctly use this control? Thanks.
This is my code:
<script language="JScript" runat="server">
var oDate = new Date();
Session("sMonth") = oDate.getMonth() + 1 + "/";
Session("sDay") = oDate.getDate() + "/";
Session("sYear") = oDate.getYear();
</script>
<script language=JScript>
function ShowDate()
{
window.alert(Calendar1.Month + "/" + Calendar1.Day + "/" + Calendar1.Year + "\r\n" + Calendar2.Month + "/" +
Calendar2.Day + "/" + Calendar2.Year);
}
</script>
<table class=innertable>
<tr height=20>
<td>
Select Starting Date:
</td>
<td>
Select Ending Date:
</td>
</tr>
<tr valign=top height=50>
<td width=50>
<OBJECT id=Calendar1 style="LEFT: 0px; TOP: 0px"classid=clsid:8E27C92B-1264-101C-8A2F-040224009C02
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="524288">
<PARAM NAME="_ExtentX" VALUE="6000">
<PARAM NAME="_ExtentY" VALUE="4000">
<PARAM NAME="_StockProps" VALUE="1">
<PARAM NAME="BackColor" VALUE="16777215">
<PARAM NAME="Year" VALUE="<%=Session("sYear")%>">
<PARAM NAME="Month" VALUE="<%=Session("sMonth")%>">
<PARAM NAME="Day" VALUE="<%=Session("sDay")%>">
<PARAM NAME="DayLength" VALUE="1">
<PARAM NAME="MonthLength" VALUE="1">
<PARAM NAME="DayFontColor" VALUE="0">
<PARAM NAME="FirstDay" VALUE="7">
<PARAM NAME="GridCellEffect" VALUE="0">
<PARAM NAME="GridFontColor" VALUE="10485760">
<PARAM NAME="GridLinesColor" VALUE="10485760">
<PARAM NAME="ShowDateSelectors" VALUE="-1">
<PARAM NAME="ShowDays" VALUE="-1">
<PARAM NAME="ShowHorizontalGrid" VALUE="-1">
<PARAM NAME="ShowTitle" VALUE="-1">
<PARAM NAME="ShowVerticalGrid" VALUE="0">
<PARAM NAME="TitleFontColor" VALUE="10485760">
<PARAM NAME="ValueIsNull" VALUE="0">
</OBJECT>
</td>
<td>
<OBJECT id=Calendar2 style="LEFT: 0px; TOP: 0px"classid=clsid:8E27C92B-1264-101C-8A2F-040224009C02
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="524288">
<PARAM NAME="_ExtentX" VALUE="6000">
<PARAM NAME="_ExtentY" VALUE="4000">
<PARAM NAME="_StockProps" VALUE="1">
<PARAM NAME="BackColor" VALUE="16777215">
<PARAM NAME="Year" VALUE="<%=Session("sYear")%>">
<PARAM NAME="Month" VALUE="<%=Session("sMonth")%>">
<PARAM NAME="Day" VALUE="<%=Session("sDay")%>">
<PARAM NAME="DayLength" VALUE="1">
<PARAM NAME="MonthLength" VALUE="1">
<PARAM NAME="DayFontColor" VALUE="0">
<PARAM NAME="FirstDay" VALUE="7">
<PARAM NAME="GridCellEffect" VALUE="0">
<PARAM NAME="GridFontColor" VALUE="10485760">
<PARAM NAME="GridLinesColor" VALUE="10485760">
<PARAM NAME="ShowDateSelectors" VALUE="-1">
<PARAM NAME="ShowDays" VALUE="-1">
<PARAM NAME="ShowHorizontalGrid" VALUE="-1">
<PARAM NAME="ShowTitle" VALUE="-1">
<PARAM NAME="ShowVerticalGrid" VALUE="0">
<PARAM NAME="TitleFontColor" VALUE="10485760">
<PARAM NAME="ValueIsNull" VALUE="0">
</OBJECT>
</td>
</tr>
<tr valign=top>
<td>
<input id=startdate name=startdate type=text value="mm/dd/yyyy">
</td>
<td>
<input id=enddate name=enddate type=text value="mm/dd/yyyy">
</td>
</tr>
<tr>
<td><INPUT id="btnShow" type=button value=Button onclick="ShowDate();">
</td>
<td>
</td>
</tr>
</table>
error "Calendar1 is undefined". Can someone help me figure out how to correctly use this control? Thanks.
This is my code:
<script language="JScript" runat="server">
var oDate = new Date();
Session("sMonth") = oDate.getMonth() + 1 + "/";
Session("sDay") = oDate.getDate() + "/";
Session("sYear") = oDate.getYear();
</script>
<script language=JScript>
function ShowDate()
{
window.alert(Calendar1.Month + "/" + Calendar1.Day + "/" + Calendar1.Year + "\r\n" + Calendar2.Month + "/" +
Calendar2.Day + "/" + Calendar2.Year);
}
</script>
<table class=innertable>
<tr height=20>
<td>
Select Starting Date:
</td>
<td>
Select Ending Date:
</td>
</tr>
<tr valign=top height=50>
<td width=50>
<OBJECT id=Calendar1 style="LEFT: 0px; TOP: 0px"classid=clsid:8E27C92B-1264-101C-8A2F-040224009C02
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="524288">
<PARAM NAME="_ExtentX" VALUE="6000">
<PARAM NAME="_ExtentY" VALUE="4000">
<PARAM NAME="_StockProps" VALUE="1">
<PARAM NAME="BackColor" VALUE="16777215">
<PARAM NAME="Year" VALUE="<%=Session("sYear")%>">
<PARAM NAME="Month" VALUE="<%=Session("sMonth")%>">
<PARAM NAME="Day" VALUE="<%=Session("sDay")%>">
<PARAM NAME="DayLength" VALUE="1">
<PARAM NAME="MonthLength" VALUE="1">
<PARAM NAME="DayFontColor" VALUE="0">
<PARAM NAME="FirstDay" VALUE="7">
<PARAM NAME="GridCellEffect" VALUE="0">
<PARAM NAME="GridFontColor" VALUE="10485760">
<PARAM NAME="GridLinesColor" VALUE="10485760">
<PARAM NAME="ShowDateSelectors" VALUE="-1">
<PARAM NAME="ShowDays" VALUE="-1">
<PARAM NAME="ShowHorizontalGrid" VALUE="-1">
<PARAM NAME="ShowTitle" VALUE="-1">
<PARAM NAME="ShowVerticalGrid" VALUE="0">
<PARAM NAME="TitleFontColor" VALUE="10485760">
<PARAM NAME="ValueIsNull" VALUE="0">
</OBJECT>
</td>
<td>
<OBJECT id=Calendar2 style="LEFT: 0px; TOP: 0px"classid=clsid:8E27C92B-1264-101C-8A2F-040224009C02
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="524288">
<PARAM NAME="_ExtentX" VALUE="6000">
<PARAM NAME="_ExtentY" VALUE="4000">
<PARAM NAME="_StockProps" VALUE="1">
<PARAM NAME="BackColor" VALUE="16777215">
<PARAM NAME="Year" VALUE="<%=Session("sYear")%>">
<PARAM NAME="Month" VALUE="<%=Session("sMonth")%>">
<PARAM NAME="Day" VALUE="<%=Session("sDay")%>">
<PARAM NAME="DayLength" VALUE="1">
<PARAM NAME="MonthLength" VALUE="1">
<PARAM NAME="DayFontColor" VALUE="0">
<PARAM NAME="FirstDay" VALUE="7">
<PARAM NAME="GridCellEffect" VALUE="0">
<PARAM NAME="GridFontColor" VALUE="10485760">
<PARAM NAME="GridLinesColor" VALUE="10485760">
<PARAM NAME="ShowDateSelectors" VALUE="-1">
<PARAM NAME="ShowDays" VALUE="-1">
<PARAM NAME="ShowHorizontalGrid" VALUE="-1">
<PARAM NAME="ShowTitle" VALUE="-1">
<PARAM NAME="ShowVerticalGrid" VALUE="0">
<PARAM NAME="TitleFontColor" VALUE="10485760">
<PARAM NAME="ValueIsNull" VALUE="0">
</OBJECT>
</td>
</tr>
<tr valign=top>
<td>
<input id=startdate name=startdate type=text value="mm/dd/yyyy">
</td>
<td>
<input id=enddate name=enddate type=text value="mm/dd/yyyy">
</td>
</tr>
<tr>
<td><INPUT id="btnShow" type=button value=Button onclick="ShowDate();">
</td>
<td>
</td>
</tr>
</table>