G
Guest
I am trying to create a popup calender so when a user click on a image on
the main form, a calender will then popup, the user will select a date and
the date will then be passed back to the main form and populate a textbox. it
works fine. but when i use it within a table cell everything worked properly
except populating the textbox with the selected date?? any suggestions will
be highly appreciated.
here's the code which popups the calendar:
<div>
<asp:textbox id=txtDate runat="server" ForeColor="Black" Width="88px">
</asp:textbox><A
onclick="window.open('Calendar.aspx?textbox=txtDate','cal','width=300,height=300,left=470,top=300')"
href="javascript:;"><IMG src="images/SmallCalendar.gif" border="0">
</A>
</div>
and here's the code for the selection change:
Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Calendar1.SelectionChanged
Dim strjscript As String = "<script language=""javascript"">"
strjscript &= "window.opener." & _
HttpContext.Current.Request.QueryString("formname") & ".value
= '" & _
Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</scr" & "ipt>"
Literal1.Text = strjscript
End Sub
the main form, a calender will then popup, the user will select a date and
the date will then be passed back to the main form and populate a textbox. it
works fine. but when i use it within a table cell everything worked properly
except populating the textbox with the selected date?? any suggestions will
be highly appreciated.
here's the code which popups the calendar:
<div>
<asp:textbox id=txtDate runat="server" ForeColor="Black" Width="88px">
</asp:textbox><A
onclick="window.open('Calendar.aspx?textbox=txtDate','cal','width=300,height=300,left=470,top=300')"
href="javascript:;"><IMG src="images/SmallCalendar.gif" border="0">
</A>
</div>
and here's the code for the selection change:
Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Calendar1.SelectionChanged
Dim strjscript As String = "<script language=""javascript"">"
strjscript &= "window.opener." & _
HttpContext.Current.Request.QueryString("formname") & ".value
= '" & _
Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</scr" & "ipt>"
Literal1.Text = strjscript
End Sub