Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP (http://www.programmingforums.org/forum32.html)
-   -   CompareValidate (http://www.programmingforums.org/showthread.php?t=7433)

Ghost Dec 7th, 2005 12:40 PM

CompareValidate
 
I'm trying to compare two dates that I have to ensure that 1 is not before the other. Here is some code I have.

:

<table>
<tr>
<td width="150">
    <div align="right">Proposal Date From:</div>
</td>
<td colSpan="2">
    <cc1:popupcalendar id="PopupCalendarProposalDateFrom"
          runat="server"
          ButtonPosition="outside"
          DefaultTodaySel="False">
</cc1:popupcalendar>
<br>
To:
<cc1:popupcalendar id="PopupCalendarProposalDateTo"
    runat="server"
    ButtonPosition="outside"
    DefaultTodaySel="False"
    ButtonOffsetX="-1"
    ButtonOffsetY="-1">
</cc1:popupcalendar>
                                       
<asp:CompareValidator id="CompareValidatorFromTo"
    runat="server"
    CssClass="ErrorLabelIcon"
    Width="12px"
    ErrorMessage="The 'Proposal Date From' must be before 'To'"
    Display="None"
    ForeColor="Red"
    Operator="GreaterThanEqual"
    Type="Date"
    ControlToCompare="PopupCalendarProposalDateTo"   
    ControlToValidate="PopupCalendarProposalDateFrom"                       
    EnableClientScript="False">
</asp:CompareValidator>

<asp:CompareValidator id="CompareValidatorFromToIcon"
    runat="server"
    CssClass="ErrorLabelIcon"
    Display="Dynamic"
    ForeColor="Red"
    Operator="GreaterThanEqual"
    Type="Date"
    ControlToCompare="PopupCalendarProposalDateTo"
    ControlToValidate="PopupCalendarProposalDateFrom"
    EnableClientScript="False">
</asp:CompareValidator>
</td>
</tr>
</table>


Everything returns an error. The PopupCalendar control I have returns dates in "MM/DD/YYYY" Format (12/07/2005)

Any help would be great, thanks.


All times are GMT -5. The time now is 2:09 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC