ClientScript working in IE but not in Mozilla

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)
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.
 
A

Adrienne

Gazing into my crystal ball I observed RuthG writing in
I changed the following line, to let ClientScript add a script wrapper:
ClientScript.RegisterStartupScript(Me.GetType(),
Guid.NewGuid().ToString, strjscript, true)

(I had previously tried it with the old RegisterStartupScript and had added
the wrapper, but when I changed to the new version, I though it wasn't
needed.)
It didn't make a difference. Still, nothing happening.
Two things, first this is a client side issue, and would be better
discussed in a client side group, like comp.lang.javascript.
Second, this is an ASP Classic group, so you might want to cross post to a
dot net group.
Please be sure to cross post, not multipost.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top