Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 7th, 2005, 12:40 PM   #1
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 290
Rep Power: 4 Ghost is on a distinguished road
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.
Ghost is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:37 AM.

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