spidervenom
Programmer
Hi,
I am pretty new to asp.net. I would like to create a pop up calendar control where users can select the date from the control and that date will then add to a textbox
I get the following error:
Run Time Error has occurred
'window.opener.frmCalendar.txtDate' is null or not an object
this is what I have done so far, but it doesn't work:
calendar.aspx
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Calendar id="Calendar1" runat="server" OnDayRender="Calendar1_dayrender" OnSelectionChanged="Calendar1_SelectionChanged" ShowTitle="true" SelectionMode="Day" Width="120" Height="60" ForeColor="#00000" BorderColor="#000000" FirstDayOfWeek="Monday" BackColor="#ffffff">
<TitleStyle backcolor="#000080" forecolor="#ffffff" />
<NextPrevStyle backcolor="#000080" forecolor="#ffffff" />
<OtherMonthDayStyle forecolor="#c0c0c0" />
</asp:Calendar>
<asp:Literal id="Literal1" runat="server"></asp:Literal>
</form>
</body>
</html>
viewTask.aspx (only part of the code is shown here)
<html>
<head>
</head>
<body>
<form name="frmCalendar" runat="server">
.
.
.
<input type="text" name="txtDate" />
<a href="javascript:calendar_window=window.open('calendar.aspx?formname=frmCalendar.txtDate','calendar_window','width=640,height=640');calendar_window.focus()">Calendar </a>
.
.
.
</form>
</body>
</html>
Thanks in advance!!
I am pretty new to asp.net. I would like to create a pop up calendar control where users can select the date from the control and that date will then add to a textbox
I get the following error:
Run Time Error has occurred
'window.opener.frmCalendar.txtDate' is null or not an object
this is what I have done so far, but it doesn't work:
calendar.aspx
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Calendar id="Calendar1" runat="server" OnDayRender="Calendar1_dayrender" OnSelectionChanged="Calendar1_SelectionChanged" ShowTitle="true" SelectionMode="Day" Width="120" Height="60" ForeColor="#00000" BorderColor="#000000" FirstDayOfWeek="Monday" BackColor="#ffffff">
<TitleStyle backcolor="#000080" forecolor="#ffffff" />
<NextPrevStyle backcolor="#000080" forecolor="#ffffff" />
<OtherMonthDayStyle forecolor="#c0c0c0" />
</asp:Calendar>
<asp:Literal id="Literal1" runat="server"></asp:Literal>
</form>
</body>
</html>
viewTask.aspx (only part of the code is shown here)
<html>
<head>
</head>
<body>
<form name="frmCalendar" runat="server">
.
.
.
<input type="text" name="txtDate" />
<a href="javascript:calendar_window=window.open('calendar.aspx?formname=frmCalendar.txtDate','calendar_window','width=640,height=640');calendar_window.focus()">Calendar </a>
.
.
.
</form>
</body>
</html>
Thanks in advance!!