Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Epoch Calendar works on IE but will not pop up in firefox or safari.

    I can't figure it out hoping for some help. The calendar pops up in IE but will not work in Firefox or safari.

    The page can be viewed at http://www.lackawanna.edu/lib-form/e...nt-request.asp
    Attached Files Attached Files

  • #2
    Regular Coder Amphiluke's Avatar
    Join Date
    Jul 2009
    Posts
    312
    Thanks
    3
    Thanked 89 Times in 89 Posts
    Just add an id attribute (emphasized with red)
    Code:
    <td> <input id="Date_needed" name="Date_needed" type="text" readonly="true" /> <img src="Request AV Equipment_files/calendar.gif" alt="Show Calendar" width="20" height="20" border="0" onclick="dp_cal.toggle();"/>
    I am still learning English

  • #3
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    You Officially Rock. Drove me nuts the all day for somthing so simple. Thank you so much.

  • #4
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    calendar popup does not work in firefox but fine in IE

    my code looks like this

    <asp:textbox id="txtDate" runat="server"></asp:textbox>
    <asp:requiredfieldvalidator id="rflDeptDate" runat="server" ErrorMessage="Departure Date Required" ControlToValidate="txtDate">*
    </asp:requiredfieldvalidator>
    <a href="javascript:calendar_window=window.open ('Calendar.aspx?formname=Form1.txtDate','calendar_wind ow','width=225,height=200,top=150,left=175');calendar_window.focus()">
    <img alt="" src="../images/calendar_sm.gif" border="0"></a>

    in Calendar.aspx as follows:
    <asp:calendar id="id" runat="server" OnSelectionChanged="id_SelectionChanged" OtherMonthDayStyle-ForeColor="white"
    TodayDayStyle-BackColor="pink" BackColor="White" BorderColor="#999999" CellPadding="4" DayNameFormat="Short"
    Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" Width="200px">
    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
    <SelectorStyle BackColor="#CCCCCC" />
    <WeekendDayStyle BackColor="#FFFFCC" />
    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
    <OtherMonthDayStyle ForeColor="#808080" />
    <NextPrevStyle VerticalAlign="Bottom" />
    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
    </asp:calendar>
    <asp:literal id="Literal1" runat="server"></asp:literal>

    In calendar.aspx.cs as follows:


    public void id_SelectionChanged(object sender, System.EventArgs e)
    {
    string strjscript = "<script language=\"javascript\">";
    //strjscript += "alert('" + id.SelectedDate.ToShortDateString() + "')";
    strjscript += "window.opener." + Request["formname"] + ".value = '" + id.SelectedDate.ToShortDateString() + "';window.opener.focus();window.close();";
    strjscript = strjscript + "</script" + ">";
    Literal1.Text = strjscript;

    }


    this works perfect in IE but not in forefox.
    can anyone help me ASAP. THnaks in advance

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,825
    Thanks
    78
    Thanked 4,413 Times in 4,378 Posts
    Next time, start your own NEW thread.

    When you just add something to a VERY OLD thread like this, most people will ignore you.

    Anyway...

    You need to show this to us "live" on a web site.

    My *GUESS* is that the bug is here:
    Code:
    strjscript += "window.opener." + Request["formname"] + ".value = '" + ...
    If Request["formname"] is supposed to be the ID of a field, then the code should read:
    Code:
    strjscript += "window.opener.document.getElementById('" + Request["formname"] + "').value = '" + ...
    If that is supposed to be the *NAME* of a field in a <form>, then it won't work, as is, in anything other than IE.

    So give the field an ID *as well as* a name and then use that ID for this.

    This code *MIGHT* work:
    Code:
    strjscript += "window.opener.forms[0]" + Request["formname"] + ".value = '" +
    but only if there is only one <form> on the opener page.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey Thanks man and next time will start a new thread.
    my issue is solved
    before it was
    strjscript += "window.opener." + Request["formname"] + ".value = '" + id.SelectedDate.ToShortDateString() + "';window.close();";

    now its

    strjscript += "window.opener.document." + Request["formname"] + ".value = '" + id.SelectedDate.ToShortDateString() + "';window.close();";


    just need to add document.

    Appreciate your help

    for reference there is one more article here

    http://forums.asp.net/t/917800.aspx


  •  

    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
    •