R
RuthG
I have date text boxes on my page and am trying to fill them from a
pop up
calendar window. I can display the popup in both IE and Mozilla
Firefox, when
I click in the text box. Here is the code to display it:
<input ID="FirstPaymentDate" type="text" runat="server"
onclick="javascript:calendar_window=window.open('calendar.aspx?
formname=frmTenant.FirstPaymentDate','calendar_window','width=180,height=198,top=350,left=320');calendar_window.focus
()"/>
But when I select a date from the calendar, my code fills in the date
in my
textbox and closes the calendar in IE, but not in Mozilla. The lines
of code
are being processed when I step through them with the debugger, but
nothing
is happening. Here is the VB.Net code:
Public Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e
As
System.EventArgs)
Dim strjscript As String
strjscript = "window.opener." &
HttpContext.Current.Request.QueryString("formname") & ".value = '" &
Calendar1.SelectedDate & "';window.close();"
ClientScript.RegisterStartupScript(Me.GetType(),
Guid.NewGuid().ToString, strjscript,true)
End Sub
Instead of the last line, I also tried putting the script in a literal
to
execute when it is rendered:
Literal1.Text = "<script language=""javascript"">" & strjscript & "</
script"
& ">"
I also tried to register an on submit and had a submit button on the
calendar form:
ClientScript.RegisterOnSubmitStatement(Me.GetType(),
Guid.NewGuid().ToString, strjscript)
Nothing happened in all these cases.
I think the problem may be a security setting in Mozilla, but I can't
find
it. Java scripts and their debugging is enabled. Blocking or
unblocking pop
up windows makes no difference. Any suggestions? I want this code to
work in
all browsers.
pop up
calendar window. I can display the popup in both IE and Mozilla
Firefox, when
I click in the text box. Here is the code to display it:
<input ID="FirstPaymentDate" type="text" runat="server"
onclick="javascript:calendar_window=window.open('calendar.aspx?
formname=frmTenant.FirstPaymentDate','calendar_window','width=180,height=198,top=350,left=320');calendar_window.focus
()"/>
But when I select a date from the calendar, my code fills in the date
in my
textbox and closes the calendar in IE, but not in Mozilla. The lines
of code
are being processed when I step through them with the debugger, but
nothing
is happening. Here is the VB.Net code:
Public Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e
As
System.EventArgs)
Dim strjscript As String
strjscript = "window.opener." &
HttpContext.Current.Request.QueryString("formname") & ".value = '" &
Calendar1.SelectedDate & "';window.close();"
ClientScript.RegisterStartupScript(Me.GetType(),
Guid.NewGuid().ToString, strjscript,true)
End Sub
Instead of the last line, I also tried putting the script in a literal
to
execute when it is rendered:
Literal1.Text = "<script language=""javascript"">" & strjscript & "</
script"
& ">"
I also tried to register an on submit and had a submit button on the
calendar form:
ClientScript.RegisterOnSubmitStatement(Me.GetType(),
Guid.NewGuid().ToString, strjscript)
Nothing happened in all these cases.
I think the problem may be a security setting in Mozilla, but I can't
find
it. Java scripts and their debugging is enabled. Blocking or
unblocking pop
up windows makes no difference. Any suggestions? I want this code to
work in
all browsers.