View Full Version : Epoch Calendar works on IE but will not pop up in firefox or safari.

07-22-2009, 06:29 PM
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/equipment-request.asp

07-22-2009, 07:43 PM
Just add an id attribute (emphasized with red)

<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();"/>

07-22-2009, 08:08 PM
You Officially Rock. Drove me nuts the all day for somthing so simple. Thank you so much.

12-29-2009, 09:50 PM
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">*
<a href="javascript:calendar_window=window.open ('Calendar.aspx?formname=Form1.txtDate','calendar_window','w idth=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: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

Old Pedant
12-30-2009, 12:22 AM
Next time, start your own NEW thread.

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


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

My *GUESS* is that the bug is here:

strjscript += "window.opener." + Request["formname"] + ".value = '" + ...

If Request["formname"] is supposed to be the ID of a field, then the code should read:

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:

strjscript += "window.opener.forms[0]" + Request["formname"] + ".value = '" +

but only if there is only one <form> on the opener page.

12-30-2009, 03:05 PM
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