I am getting my date in the following format: dd/mm/yyyy, but would like in this format: mm/dd/yyyy.
I have 2 pages: form.aspx and popup.aspx.
On the form.aspx I have the following snippet where the textbox is located:
<asp:Label id="Label7" runat="server">Date</asp:Label>
<asp:TextBox id="txtDate" runat="server">
</asp:TextBox>
<A href="javascript:GetDate('txtDate')"><IMG style="WIDTH: 18px; HEIGHT: 16px" height="16" alt="PopUp Calendar" src="calendar.gif" width="18" border="0"></A>
[/blue]
And at the top (head) of this page, there is some javascript:
<script language="Javascript">
function GetDate(CtrlName)
{
ChildWindow = window.open('Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlName, "PopUpCalendar", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no"
}
function CheckWindow()
{
ChildWindow.close();
}
</script>
[/blue]
My calendar.aspx file has the following:
<HTML>
<HEAD>
<script language="Javascript">
function ReturnDate()
{
window.opener.document.forms["<%= strFormName %>"].elements["<%= strCtrlName %>"].value = "<%= strSelectedDate %>";
window.close();
}
function Close()
{
window.close();
}
</script>
</HEAD>
<body>
<form runat="server" ID="Form1">
<table>
<tr>
<td align="middle">
<asp:Calendar id="myCalendar" runat="server" BorderWidth="1px" BackColor="White" Width="220px" DayNameFormat="FirstLetter" ForeColor="#003399" Height="200px" Font-Size="8pt" Font-Names="Verdana" BorderColor="#3366CC" OnSelectionChanged="myCalendar_SelectionChanged" CellPadding="1" BorderStyle="Double">
</asp:Calendar>
</td>
</tr>
<tr>
<td align="middle">
<input id="btnReturnDate" onclick="Javascript:ReturnDate()" type="button" value="Select" runat="Server" NAME="btnReturnDate">
<input id="btnCloseWindow" onclick="Javascript:Close()" type="button" value="Close" runat="Server" NAME="btnCloseWindow">
</td>
</tr>
</table>
</form>
</body>
</HTML>
[/red]
I can't seem to figure where is the formatting of the date!!
I have 2 pages: form.aspx and popup.aspx.
On the form.aspx I have the following snippet where the textbox is located:
<asp:Label id="Label7" runat="server">Date</asp:Label>
<asp:TextBox id="txtDate" runat="server">
</asp:TextBox>
<A href="javascript:GetDate('txtDate')"><IMG style="WIDTH: 18px; HEIGHT: 16px" height="16" alt="PopUp Calendar" src="calendar.gif" width="18" border="0"></A>
[/blue]
And at the top (head) of this page, there is some javascript:
<script language="Javascript">
function GetDate(CtrlName)
{
ChildWindow = window.open('Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlName, "PopUpCalendar", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no"
}
function CheckWindow()
{
ChildWindow.close();
}
</script>
[/blue]
My calendar.aspx file has the following:
<HTML>
<HEAD>
<script language="Javascript">
function ReturnDate()
{
window.opener.document.forms["<%= strFormName %>"].elements["<%= strCtrlName %>"].value = "<%= strSelectedDate %>";
window.close();
}
function Close()
{
window.close();
}
</script>
</HEAD>
<body>
<form runat="server" ID="Form1">
<table>
<tr>
<td align="middle">
<asp:Calendar id="myCalendar" runat="server" BorderWidth="1px" BackColor="White" Width="220px" DayNameFormat="FirstLetter" ForeColor="#003399" Height="200px" Font-Size="8pt" Font-Names="Verdana" BorderColor="#3366CC" OnSelectionChanged="myCalendar_SelectionChanged" CellPadding="1" BorderStyle="Double">
</asp:Calendar>
</td>
</tr>
<tr>
<td align="middle">
<input id="btnReturnDate" onclick="Javascript:ReturnDate()" type="button" value="Select" runat="Server" NAME="btnReturnDate">
<input id="btnCloseWindow" onclick="Javascript:Close()" type="button" value="Close" runat="Server" NAME="btnCloseWindow">
</td>
</tr>
</table>
</form>
</body>
</HTML>
[/red]
I can't seem to figure where is the formatting of the date!!