Welcome Guest Search | Active Topics | Sign In | Register

Multiple Date picker controls Options
Raghav Nayak
Posted: Monday, April 6, 2009 2:48:08 AM
Rank: Advanced Member
Groups: Member

Joined: 8/21/2008
Posts: 37
Hi,

I'm using the multiple date picker controls in a form. I've also added the year and month ContextMenu in the datepicker user control. When I try to select the year from the first date picker(dpMedicalDate) control in the form, it'll not work. Only the last date picker(dpDueDate) control will work. That too the year ContextMenu will appear some where in the top of the page. Could you please help me to solve the date picker issue? Below is the code.

DatePicker.ascx

Code: HTML/ASPX
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<%@ Control AutoEventWireup="true" CodeFile="DatePicker.ascx.cs" Inherits="DatePicker" Language="C#" %>

<script type="text/javascript">

var g_curCalendar = null;

function ShowMonthPopup(refLink)
{
	g_curCalendar = "<%=DatePicker1.ClientID%>";
	var monthPicker = document.getElementById(refLink);
	eo_GetObject(g_curCalendar).showContextMenu(monthPicker, "mnuMonth");
}

function MonthMenuClicked(e, info)
{
	var month = info.getItem().getIndex();
	var calendar = eo_GetObject(g_curCalendar);
	
	//Get the current month
	var curMonth = calendar.getVisibleDate();
	
	//Change the month
	curMonth.setMonth(month);
	
	//Set the new current month
	calendar.goTo(curMonth);
}

function ShowYearPopup(refLink)
{
	g_curCalendar = "<%=DatePicker1.ClientID%>";
	var yearPicker = document.getElementById(refLink);
	eo_GetObject(g_curCalendar).showContextMenu(yearPicker, "mnuYear");
}

function YearMenuClicked(e, info)
{
	var year = info.getItem().getIndex();
	var calendar = eo_GetObject(g_curCalendar);
	
	//Get the current month
	var curMonth = calendar.getVisibleDate();
	
	//Set the new year
	curMonth.setFullYear(year + 1950);
	
	//Set the new current month
	calendar.goTo(curMonth);
}

function ValidateDates(clientID)
{
	//Clear the message first
	var errorDiv = document.getElementById("errordiv");
	errorDiv.innerHTML = "";
	
	//Get the date
	var date = eo_GetObject(clientID).getSelectedDate();	
	
	//Check if date is provided
	if ((date == null))
	{
		errorDiv.innerHTML = "Please select date";
		errordiv.className = "validator_text";
		return false;		
	}	
}

function ValidateWithCurrentDate(sender, args)
{    
    var ctrltova = sender.getAttribute('ControlToValidate');
    var givenDate = eo_GetObject(ctrltova).getSelectedDate();
    
    var operator =  parseInt(sender.getAttribute('operatorID'), 10);
    var currentDateString =  sender.getAttribute('CurrentDate');
    
    var Day = currentDateString.split('/')[0];
    var Month = currentDateString.split('/')[1];
    var Year = currentDateString.split('/')[2]; 
		    		    
	var iDay = eval(Day);
	var iMonth = eval(Month);
	var iYear = eval(Year);	    
    
    var currentDate = new Date(iYear, iMonth - 1, iDay);
   
    switch(operator)
    {
        case 1:
             args.IsValid = givenDate == currentDate;
             break;
        case 2:
             args.IsValid = givenDate != currentDate;
             break;
        case 3:
             args.IsValid = givenDate > currentDate;
             break;
        case 4:
             args.IsValid = givenDate >= currentDate;
             break;
        case 5:
             args.IsValid = givenDate < currentDate;
             break;
        case 6:
             args.IsValid = givenDate <= currentDate;
             break;
    }
}

eo:DatePicker ID="DatePicker1" runat="server" DayCellHeight="15" DayCellWidth="31" DayHeaderFormat="FirstLetter" GridLineColor="207, 217,  227"
    GridLineFrameVisible="False" GridLineVisible="True" PickerFormat="dd/MM/yyyy" TitleFormat="MMM yyyy" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
    TitleRightArrowImageUrl="DefaultSubMenuIcon" TitleTemplateScope="TextOnly" Width="100px">
    <TitleTemplate>
        {var:visible_date:MMMM} <a id="month_picker2" href="javascript:ShowMonthPopup('month_picker2')">
            <img border="0" src="{img:00020012}" /></a> {var:visible_date:yyyy} <a id="year_picker2" href="javascript:ShowYearPopup('year_picker2')">
                <img border="0" src="{img:00020012}" /></a>
    </TitleTemplate>
    <SelectedDayStyle CssText="background-color:White;border-bottom-color:Black;bor der-bottom-style:solid;border-bottom-width:1px;border-left-co lor:Black;border-left-style:solid;border-left-width:1px;borde r-right-color:Black;border-right-style:solid;border-right-wid th:1px;border-top-color:Black;border-top-style:solid;border-t op-width:1px;" />
    <DisabledDayStyle CssText="border-bottom-color:#CFD9C0;border-bottom-style:soli d;border-bottom-width:1px;border-left-color:#CFD9C0;border-le ft-style:solid;border-left-width:1px;border-right-color:#CFD9 C0;border-right-style:solid;border-right-width:1px;border-top -color:#CFD9C0;border-top-style:solid;border-top-width:1px;co lor:gray;" />
    <CalendarStyle CssText="border-right: #555566 1px solid;  border-top: #555566 1px solid; border-left: #555566 1px  solid; border-bottom: #555566 1px solid; background-color:  #ebe9ed" />
    <DayHoverStyle CssText="border-right: #bbbbbb 1px solid;  border-top: #bbbbbb 1px solid; border-left: #bbbbbb 1px  solid; border-bottom: #bbbbbb 1px solid; background-color:  #ddeeff" />
    <MonthStyle CssText="font-size: 8pt; cursor: hand;  font-family: verdana; background-color: #cfd9c0" />
    <DayStyle CssText="border-bottom-color:#CFD9C0;border-bottom-style:soli d;border-bottom-width:1px;border-left-color:#CFD9C0;border-le ft-style:solid;border-left-width:1px;border-right-color:#CFD9 C0;border-right-style:solid;border-right-width:1px;border-top -color:#CFD9C0;border-top-style:solid;border-top-width:1px;" />
    <DayHeaderStyle CssText="font-weight: bold; font-size:  11px; color: black; border-bottom: #555566 1px solid;  font-family: verdana; background-color: #ae9c86" />
    <PickerStyle CssText="background-color:pink" />
    <TodayStyle CssText="background-image:url('00040401');color:#1176db;" />
    <DayHeaderStyle CssText="border-bottom: #f5f5f5 1px solid" />
</eo:DatePicker>
<eo:ContextMenu ID="mnuMonth" runat="server" ClientSideOnItemClick="MonthMenuClicked" ControlSkinID="None" Width="80px">
    <TopGroup OffsetX="0" OffsetY="-100" Style-CssText="border-left-color:#e0e0e0;border-left-style:solid;border-left-width:1px;border-right-color:#e0e0e0;border-right-style:solid;border-right-width:1px;border-top-color:#e0e0e0;border-top-style:solid;border-top-width:1px;cursor:hand;font-family:arial;font-size:12px;padding-bottom:3px;padding-left:10px;padding-right:10px;padding-top:3px;">
        <Items>
            <eo:MenuItem Text-Html="January">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="February">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="March">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="April">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="May">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="June">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="July">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="August">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="September">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="October">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="November">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="December">
            </eo:MenuItem>
        </Items>
    </TopGroup>
    <LookItems>
        <eo:MenuItem HoverStyle-CssText="color:#1C7CDC;padding-left:5px;padding-right:5px;" ItemID="_Default" NormalStyle-CssText="color:#2C0B1E;padding-left:5px;padding-right:5px;">
            <SubMenu ItemSpacing="5" ShadowDepth="0" Style-CssText="background-color:White;border-bottom-color:#e0e0e0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#e0e0e0;border-left-style:solid;border-left-width:1px;border-right-color:#e0e0e0;border-right-style:solid;border-right-width:1px;border-top-color:#e0e0e0;border-top-style:solid;border-top-width:1px;color:#606060;cursor:hand;font-family:arial;font-size:12px;padding-bottom:3px;padding-left:3px;padding-right:3px;padding-top:3px;">
            </SubMenu>
        </eo:MenuItem>
    </LookItems>
</eo:ContextMenu>
<eo:ContextMenu ID="mnuYear" runat="server" ClientSideOnItemClick="YearMenuClicked" ControlSkinID="None" EnableScrolling="True"
    ScrollDownLookID="scroll_down" ScrollUpLookID="scroll_up" Width="80px">
    <TopGroup Height="150" OffsetX="0" OffsetY="-50" Style-CssText="border-left-color:#e0e0e0;border-left-style:solid;border-left-width:1px;border-right-color:#e0e0e0;border-right-style:solid;border-right-width:1px;border-top-color:#e0e0e0;border-top-style:solid;border-top-width:1px;cursor:hand;font-family:arial;font-size:12px;padding-bottom:3px;padding-left:10px;padding-right:10px;padding-top:3px;">
        <Items>
            <eo:MenuItem Text-Html="1950">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1951">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1952">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1953">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1954">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1955">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1956">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1957">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1958">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1959">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1960">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1961">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1962">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1963">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1964">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1965">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1966">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1967">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1968">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1969">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1970">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1971">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1972">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1973">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1974">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1975">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1976">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1977">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1978">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1979">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1980">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1981">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1982">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1983">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1984">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1985">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1986">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1987">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1988">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1989">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1990">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1991">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1992">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1993">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1994">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1995">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1996">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1997">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1998">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1999">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2000">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2001">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2002">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2003">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2004">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2005">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2006">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2007">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2008">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2009">
            </eo:MenuItem>
        </Items>
    </TopGroup>
    <LookItems>
        <eo:MenuItem HoverStyle-CssText="color:#1C7CDC;padding-left:5px;padding-right:5px;" ItemID="_Default" NormalStyle-CssText="color:#2C0B1E;padding-left:5px;padding-right:5px;">
            <SubMenu ItemSpacing="5" ShadowDepth="0" Style-CssText="background-color:White;border-bottom-color:#e0e0e0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#e0e0e0;border-left-style:solid;border-left-width:1px;border-right-color:#e0e0e0;border-right-style:solid;border-right-width:1px;border-top-color:#e0e0e0;border-top-style:solid;border-top-width:1px;color:#606060;cursor:hand;font-family:arial;font-size:12px;padding-bottom:3px;padding-left:3px;padding-right:3px;padding-top:3px;">
            </SubMenu>
        </eo:MenuItem>
        <eo:MenuItem Height="14" Image-Url="00020001" ItemID="scroll_down" NormalStyle-CssText="background-image:url('00020005');border-bottom-color:#E0E0E0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#E0E0E0;border-left-style:solid;border-left-width:1px;border-right-color:#E0E0E0;border-right-style:solid;border-right-width:1px;border-top-color:#E0E0E0;border-top-style:solid;border-top-width:1px;">
        </eo:MenuItem>
        <eo:MenuItem Height="14" Image-Url="00020000" ItemID="scroll_up" NormalStyle-CssText="background-image:url('00020005');border-bottom-color:#E0E0E0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#E0E0E0;border-left-style:solid;border-left-width:1px;border-right-color:#E0E0E0;border-right-style:solid;border-right-width:1px;border-top-color:#E0E0E0;border-top-style:solid;border-top-width:1px;">
        </eo:MenuItem>
    </LookItems>
</eo:ContextMenu>
<input id="hdnMessage" runat="server" type="text" visible="false" />
<asp:RequiredFieldValidator ID="rfvDatePicker" runat="server" CssClass="validator_text" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvDatePickerWithCurrentDate" runat="server" ClientValidationFunction="ValidateWithCurrentDate" ControlToValidate="DatePicker1"
    CssClass="validator_text" Display="dynamic" Enabled="false" ForeColor="">  </asp:CustomValidator>
<input id="hdnCalendarDate" runat="server" type="hidden" />



ChildChecks.aspx

Code: HTML/ASPX
<%@ Page AutoEventWireup="true" CodeFile="ChildChecks.aspx.cs" Inherits="WEB_FosterChild_ChildChecks" Language="C#" MasterPageFile="~/WEB/MasterPage.master"
    Title="Social eCare - Statutory Medical" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<%@ Register Src="~/SITE/UserControls/DatePicker.ascx" TagName="DatePicker" TagPrefix="ucDate" %>
<%@ Register Src="~/SITE/UserControls/TextArea.ascx" TagName="TextArea" TagPrefix="uc" %>
<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="middleContent">

    <script language="javascript" type="text/javascript">
    function CheckTwoDates(sender , args)
    {    
        var endDate = eo_GetObject("ctl00_middleContent_dpMedicalDate_DatePicker1").getSelectedDate();
        var followupdate = eo_GetObject("ctl00_middleContent_dpDueDate_DatePicker1").getSelectedDate();
       
        //Check if both dates are provided
        if ((endDate != null) && (followupdate != null))
        {
            //Check if the start date is before the end date
            if (endDate.valueOf() > followupdate.valueOf())
            {
                args.IsValid = false;
            }  
            else
            {
                args.IsValid = true;
            }      
        }
    }
    </script>

    <table id="tblChecksList" runat="server" border="0" cellpadding="5" cellspacing="1" class="tablebgcolor" width="85%">
        <tr class="trbgcolor">
            <td align="left" class="head" colspan="2">
                Statutory Medical</td>
        </tr>
        <tr class="trbgcolor">
            <td id="tbcInstructions" align="left" class="text01" colspan="2">
                <input id="hdnID" runat="server" name="hdnID" type="hidden" />
                <input id="hdnID2" runat="server" name="hdnID2" type="hidden" />
            </td>
        </tr>
        <tr class="trbgcolor">
            <td align="left" class="text01" colspan="2">
                <asp:Label ID="lblMessage2" runat="server" CssClass="required"></asp:Label></td>
        </tr>
    </table>
    <table id="tblStatutoryData" runat="server" border="0" cellpadding="5" cellspacing="1" visible="false" width="85%">
        <tr class="trbgcolor">
            <td class="text01" colspan="2">
                <b>
                    <asp:Label ID="lblCheckType2" runat="server"></asp:Label></b></td>
        </tr>
        <tr class="trbgcolor">
            <td align="right" class="text01" style="width: 23%">
                <asp:Label ID="lblCheckType3" runat="server" SkinID="title"></asp:Label>
                Date</td>
            <td class="text03">
                <ucDate:DatePicker ID="dpMedicalDate" runat="server" />
                <asp:CustomValidator ID="cvMedicalDate" runat="server" ClientValidationFunction="CheckTwoDates" ControlToCompare="dpMedicalDate"
                    Display="Dynamic" ErrorMessage="The Dental/Medical/Optician date must be less than due date." ForeColor="#C00000"></asp:CustomValidator>
            </td>
        </tr>
        <tr class="trbgcolor">
            <td align="right" class="text01">
                Due Date</td>
            <td class="text03">
                <ucDate:DatePicker ID="dpDueDate" runat="server" />
            </td>
        </tr>
        <tr class="trbgcolor">
            <td align="right" class="text01" valign="top">
                Result</td>
            <td class="text03">
                <uc:TextArea ID="txtResult" runat="server" MaxLength="2000" Width="290" />
            </td>
        </tr>
        <tr class="trbgcolor">
            <td align="right" class="text01" valign="top">
                Comments</td>
            <td class="text03">
                <uc:TextArea ID="txtComments" runat="server" MaxLength="2000" Width="290" />
            </td>
        </tr>
        <tr class="trbgcolor">
            <td align="center" class="text01" colspan="3">
                <input id="btnSave" runat="server" class="button1" onserverclick="btnSave_ServerClick" type="button" value="   Save " />
                <input id="btnCancel" runat="server" class="button1" type="button" value=" Cancel " onserverclick="Button1_ServerClick" /></td>
        </tr>
    </table>
</asp:Content>
eo_support
Posted: Monday, April 6, 2009 9:23:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

This is a code error. You need to move the JavaScript function outside of the user control. Otherwise when the second instance of your user control is rendered, it overwrites the body of the JavaScript functions rendered by the first user control. The following post explained this in detail:

http://www.essentialobjects.com/forum/postst830_DatePicker-Error.aspx#7171

Thanks
Raghav Nayak
Posted: Tuesday, April 7, 2009 4:09:01 AM
Rank: Advanced Member
Groups: Member

Joined: 8/21/2008
Posts: 37
Hi,

Thank you very much. I've modified the code accordingly and below is the working one.

Regards,
Raghav


Code: HTML/ASPX
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<%@ Control AutoEventWireup="true" CodeFile="DatePicker.ascx.cs" Inherits="DatePicker" Language="C#" %>

<script type="text/javascript">

var g_curCalendar = null;

function ShowMonthPopup(id)
{
    g_curCalendar = eo_GetObject(id);
    var menuId = id + "_mnuMonth";
    var ref = document.getElementById(id);
    g_curCalendar.showContextMenu(ref, menuId);
}

function MonthMenuClicked(e, info)
{
	var month = info.getItem().getIndex();
	var calendar = g_curCalendar;
	
	//Get the current month
	var curMonth = calendar.getVisibleDate();
	
	//Change the month
	curMonth.setMonth(month);
	
	//Set the new current month
	calendar.goTo(curMonth);
}

function ShowYearPopup(id)
{
    g_curCalendar = eo_GetObject(id);
    var menuId = id + "_mnuYear";
    var ref = document.getElementById(id);
    g_curCalendar.showContextMenu(ref, menuId);
}

function YearMenuClicked(e, info)
{
	var year = info.getItem().getIndex();
	var calendar = g_curCalendar;
	
	//Get the current month
	var curMonth = calendar.getVisibleDate();
	
	//Set the new year
	curMonth.setFullYear(year + 1950);
	
	//Set the new current month
	calendar.goTo(curMonth);
}

function ValidateDates(clientID)
{
	//Clear the message first
	var errorDiv = document.getElementById("errordiv");
	errorDiv.innerHTML = "";
	
	//Get the date
	var date = eo_GetObject(clientID).getSelectedDate();	
	
	//Check if date is provided
	if ((date == null))
	{
		errorDiv.innerHTML = "Please select date";
		errordiv.className = "validator_text";
		return false;		
	}	
}

function ValidateWithCurrentDate(sender, args)
{    
    var ctrltova = sender.getAttribute('ControlToValidate');
    var givenDate = eo_GetObject(ctrltova).getSelectedDate();
    
    var operator =  parseInt(sender.getAttribute('operatorID'), 10);
    var currentDateString =  sender.getAttribute('CurrentDate');
    
    var Day = currentDateString.split('/')[0];
    var Month = currentDateString.split('/')[1];
    var Year = currentDateString.split('/')[2]; 
		    		    
	var iDay = eval(Day);
	var iMonth = eval(Month);
	var iYear = eval(Year);	    
    
    var currentDate = new Date(iYear, iMonth - 1, iDay);
   
    switch(operator)
    {
        case 1:
             args.IsValid = givenDate == currentDate;
             break;
        case 2:
             args.IsValid = givenDate != currentDate;
             break;
        case 3:
             args.IsValid = givenDate > currentDate;
             break;
        case 4:
             args.IsValid = givenDate >= currentDate;
             break;
        case 5:
             args.IsValid = givenDate < currentDate;
             break;
        case 6:
             args.IsValid = givenDate <= currentDate;
             break;
    }
}

eo:DatePicker ID="DatePicker1" runat="server" DayCellHeight="15" DayCellWidth="31" DayHeaderFormat="FirstLetter" GridLineColor="207, 217,  227"
    GridLineFrameVisible="False" GridLineVisible="True" PickerFormat="dd/MM/yyyy" TitleFormat="MMM yyyy" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
    TitleRightArrowImageUrl="DefaultSubMenuIcon" TitleTemplateScope="TextOnly" Width="100px">
    <TitleTemplate>
        {var:visible_date:MMMM} <a id="month_picker2" href="javascript:ShowMonthPopup({var:this}.getId());">
            <img border="0" src="{img:00020012}" /></a> {var:visible_date:yyyy} <a id="year_picker2" href="javascript:ShowYearPopup({var:this}.getId());">
                <img border="0" src="{img:00020012}" /></a>
    </TitleTemplate>
    <SelectedDayStyle CssText="background-color:White;border-bottom-color:Black;bor der-bottom-style:solid;border-bottom-width:1px;border-left-co lor:Black;border-left-style:solid;border-left-width:1px;borde r-right-color:Black;border-right-style:solid;border-right-wid th:1px;border-top-color:Black;border-top-style:solid;border-t op-width:1px;" />
    <DisabledDayStyle CssText="border-bottom-color:#CFD9C0;border-bottom-style:soli d;border-bottom-width:1px;border-left-color:#CFD9C0;border-le ft-style:solid;border-left-width:1px;border-right-color:#CFD9 C0;border-right-style:solid;border-right-width:1px;border-top -color:#CFD9C0;border-top-style:solid;border-top-width:1px;co lor:gray;" />
    <CalendarStyle CssText="border-right: #555566 1px solid;  border-top: #555566 1px solid; border-left: #555566 1px  solid; border-bottom: #555566 1px solid; background-color:  #ebe9ed" />
    <DayHoverStyle CssText="border-right: #bbbbbb 1px solid;  border-top: #bbbbbb 1px solid; border-left: #bbbbbb 1px  solid; border-bottom: #bbbbbb 1px solid; background-color:  #ddeeff" />
    <MonthStyle CssText="font-size: 8pt; cursor: hand;  font-family: verdana; background-color: #cfd9c0" />
    <DayStyle CssText="border-bottom-color:#CFD9C0;border-bottom-style:soli d;border-bottom-width:1px;border-left-color:#CFD9C0;border-le ft-style:solid;border-left-width:1px;border-right-color:#CFD9 C0;border-right-style:solid;border-right-width:1px;border-top -color:#CFD9C0;border-top-style:solid;border-top-width:1px;" />
    <DayHeaderStyle CssText="font-weight: bold; font-size:  11px; color: black; border-bottom: #555566 1px solid;  font-family: verdana; background-color: #ae9c86" />
    <PickerStyle CssText="background-color:pink" />
    <TodayStyle CssText="background-image:url('00040401');color:#1176db;" />
    <DayHeaderStyle CssText="border-bottom: #f5f5f5 1px solid" />
</eo:DatePicker>
<eo:ContextMenu ID="DatePicker1_mnuMonth" runat="server" ClientSideOnItemClick="MonthMenuClicked" ControlSkinID="None" Width="80px">
    <TopGroup OffsetX="0" OffsetY="-100" Style-CssText="border-left-color:#e0e0e0;border-left-style:solid;border-left-width:1px;border-right-color:#e0e0e0;border-right-style:solid;border-right-width:1px;border-top-color:#e0e0e0;border-top-style:solid;border-top-width:1px;cursor:hand;font-family:arial;font-size:12px;padding-bottom:3px;padding-left:10px;padding-right:10px;padding-top:3px;">
        <Items>
            <eo:MenuItem Text-Html="January">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="February">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="March">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="April">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="May">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="June">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="July">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="August">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="September">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="October">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="November">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="December">
            </eo:MenuItem>
        </Items>
    </TopGroup>
    <LookItems>
        <eo:MenuItem HoverStyle-CssText="color:#1C7CDC;padding-left:5px;padding-right:5px;" ItemID="_Default" NormalStyle-CssText="color:#2C0B1E;padding-left:5px;padding-right:5px;">
            <SubMenu ItemSpacing="5" ShadowDepth="0" Style-CssText="background-color:White;border-bottom-color:#e0e0e0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#e0e0e0;border-left-style:solid;border-left-width:1px;border-right-color:#e0e0e0;border-right-style:solid;border-right-width:1px;border-top-color:#e0e0e0;border-top-style:solid;border-top-width:1px;color:#606060;cursor:hand;font-family:arial;font-size:12px;padding-bottom:3px;padding-left:3px;padding-right:3px;padding-top:3px;">
            </SubMenu>
        </eo:MenuItem>
    </LookItems>
</eo:ContextMenu>
<eo:ContextMenu ID="DatePicker1_mnuYear" runat="server" ClientSideOnItemClick="YearMenuClicked" ControlSkinID="None" EnableScrolling="True"
    ScrollDownLookID="scroll_down" ScrollUpLookID="scroll_up" Width="80px">
    <TopGroup Height="150" OffsetX="0" OffsetY="-50" Style-CssText="border-left-color:#e0e0e0;border-left-style:solid;border-left-width:1px;border-right-color:#e0e0e0;border-right-style:solid;border-right-width:1px;border-top-color:#e0e0e0;border-top-style:solid;border-top-width:1px;cursor:hand;font-family:arial;font-size:12px;padding-bottom:3px;padding-left:10px;padding-right:10px;padding-top:3px;">
        <Items>
            <eo:MenuItem Text-Html="1950">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1951">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1952">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1953">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1954">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1955">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1956">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1957">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1958">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1959">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1960">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1961">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1962">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1963">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1964">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1965">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1966">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1967">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1968">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1969">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1970">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1971">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1972">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1973">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1974">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1975">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1976">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1977">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1978">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1979">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1980">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1981">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1982">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1983">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1984">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1985">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1986">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1987">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1988">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1989">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1990">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1991">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1992">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1993">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1994">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1995">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1996">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1997">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1998">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="1999">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2000">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2001">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2002">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2003">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2004">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2005">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2006">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2007">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2008">
            </eo:MenuItem>
            <eo:MenuItem Text-Html="2009">
            </eo:MenuItem>
        </Items>
    </TopGroup>
    <LookItems>
        <eo:MenuItem HoverStyle-CssText="color:#1C7CDC;padding-left:5px;padding-right:5px;" ItemID="_Default" NormalStyle-CssText="color:#2C0B1E;padding-left:5px;padding-right:5px;">
            <SubMenu ItemSpacing="5" ShadowDepth="0" Style-CssText="background-color:White;border-bottom-color:#e0e0e0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#e0e0e0;border-left-style:solid;border-left-width:1px;border-right-color:#e0e0e0;border-right-style:solid;border-right-width:1px;border-top-color:#e0e0e0;border-top-style:solid;border-top-width:1px;color:#606060;cursor:hand;font-family:arial;font-size:12px;padding-bottom:3px;padding-left:3px;padding-right:3px;padding-top:3px;">
            </SubMenu>
        </eo:MenuItem>
        <eo:MenuItem Height="14" Image-Url="00020001" ItemID="scroll_down" NormalStyle-CssText="background-image:url('00020005');border-bottom-color:#E0E0E0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#E0E0E0;border-left-style:solid;border-left-width:1px;border-right-color:#E0E0E0;border-right-style:solid;border-right-width:1px;border-top-color:#E0E0E0;border-top-style:solid;border-top-width:1px;">
        </eo:MenuItem>
        <eo:MenuItem Height="14" Image-Url="00020000" ItemID="scroll_up" NormalStyle-CssText="background-image:url('00020005');border-bottom-color:#E0E0E0;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#E0E0E0;border-left-style:solid;border-left-width:1px;border-right-color:#E0E0E0;border-right-style:solid;border-right-width:1px;border-top-color:#E0E0E0;border-top-style:solid;border-top-width:1px;">
        </eo:MenuItem>
    </LookItems>
</eo:ContextMenu>
<input id="hdnMessage" runat="server" type="text" visible="false" />
<asp:RequiredFieldValidator ID="rfvDatePicker" runat="server" CssClass="validator_text" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvDatePickerWithCurrentDate" runat="server" ClientValidationFunction="ValidateWithCurrentDate" ControlToValidate="DatePicker1"
    CssClass="validator_text" Display="dynamic" Enabled="false" ForeColor="">  </asp:CustomValidator>
<input id="hdnCalendarDate" runat="server" type="hidden" />
eo_support
Posted: Tuesday, April 7, 2009 8:29:41 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Thanks for sharing!



You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.