Results 1 to 5 of 5

Thread: undefined in ff but fine in IE

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Location
    Karachi
    Posts
    551

    undefined in ff but fine in IE

    see the code
    Code:
     <tr>
                    <td>
                       End Date of Conference</td>
                    <td>
                        <asp:TextBox ID="txt_enddays" runat="server" onchange="checkdate(this);"></asp:TextBox> 
                           <a href="javascript:calendar_window=window.open('calendar.aspx?form1=form1.txt_enddays','calendar_window','width=554,height=488');calendar_window.focus()">
    
                                                    <img alt=""  src="images/calendar.png"   />  
                                                    </a> 
                              </td>
                </tr>

    Code:
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="calendar.aspx.vb" Inherits="gfln1.calendar_aspx" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
         <script runat="server">
        Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender 
                      If e.Day.Date < DateTime.Today.Date Then 
                                 e.Cell.Enabled = False        
                                 e.Cell.ToolTip = "This date is not available"                      
                     End If 
        End Sub
    
    Private Sub Calendar1_SelectionChanged(sender As Object, e As EventArgs)
        Dim strjscript As String = "<script language=""javascript"">"
        
            strjscript &= "window.opener." & _
                  HttpContext.Current.Request.QueryString("form1") & ".value = '" & Calendar1.SelectedDate & "';window.close();"
            strjscript = strjscript & "</script" & ">" 'Don't Ask, Tool Bug
    
            Literal1.Text = strjscript  'Set the literal control's text to the JScript code
    
    End Sub
    
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
         <asp:Calendar id="Calendar1" runat="server" 
                         OnSelectionChanged="Calendar1_SelectionChanged" 
                        
                         ShowTitle="true" DayNameFormat="FirstTwoLetters" 
                         SelectionMode="Day" BackColor="#ffffff" 
                         FirstDayOfWeek="Monday" BorderColor="#000000" 
                         ForeColor="#00000" Height="60" Width="120">
            <TitleStyle backcolor="#000080" forecolor="#ffffff" />
            <NextPrevStyle backcolor="#000080" forecolor="#ffffff" />
            <OtherMonthDayStyle forecolor="#c0c0c0" />
        </asp:Calendar>
        <asp:Literal id="Literal1" runat="server"></asp:Literal>
    </div>
        </form>
    </body>
    </html>
    Error: window.opener.form1 is undefined
    Source File: http://localhost:2107/calendar.aspx?....txt_startDays
    Line: 44

    any help
    There is no achievement without goals

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: undefined in ff but fine in IE

    I think you just need to refer to the document of window.opener; use window.opener.document.form1.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Location
    Karachi
    Posts
    551

    Re: undefined in ff but fine in IE

    it is still not opening any calender

    i think u r saying this
    Code:
         <asp:TextBox  ID="txt_startDays" runat="server" onchange="checkdate(this);" ></asp:TextBox>
                           <a href="javascript:calendar_window=window.opener.document.form1('calendar.aspx?form1=form1.txt_startDays','calendar_window','width=554,height=488');calendar_window.focus()">
    
                                                    <img alt=""  src="images/calendar.png"   />  
                                                    </a> 
                              
                        </td>
    its opening in the following code

    Code:
          <td>
                       End Date of Conference</td>
                    <td>
                        <asp:TextBox ID="txt_enddays" runat="server" onchange="checkdate(this);"></asp:TextBox> 
                           <a href="javascript:calendar_window=window.open('calendar.aspx?form1=form1.txt_enddays','calendar_window','width=554,height=488');calendar_window.focus()">
    
                                                    <img alt=""  src="images/calendar.png"   />  
                                                    </a> 
                              </td>
    but main problem is that it does hide any proviuos data ,seconly not pick any date and copy to textbox
    There is no achievement without goals

  4. #4
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: undefined in ff but fine in IE

    I'm not sure I follow you. This is NOT what I was saying to do:
    Code:
         <asp:TextBox  ID="txt_startDays" runat="server" onchange="checkdate(this);" ></asp:TextBox>
                           <a href="javascript:calendar_window=window.opener.document.form1('calendar.aspx?form1=form1.txt_startDays','calendar_window','width=554,height=488');calendar_window.focus()">
    
                                                    <img alt=""  src="images/calendar.png"   />  
                                                    </a> 
                              
                        </td>
    I meant that, in any Javascript that you use in the pop-up window you open, when you want to refer to a form element in its parent window, you'll need to use the document object.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Location
    Karachi
    Posts
    551

    Re: undefined in ff but fine in IE

    Thanks help for all

    yes its working fine but why it is highlighting old days in calender
    calender code is same as i posted before
    There is no achievement without goals

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width