I'm using the CompareValidator
to ensure that a finish date cannot be set before a start date. So far with no joy, at the moment when it brings up an error message even if the start date entered is set before the finish date? Here is my code:
<td class="question">
Finish Date and Time
</td>
<td>
<asp:TextBox runat="server" ID="TxtFinish" CssClass="answer" MaxLength="50" Width="100px"/>
<span class="mandatory">*</span>
<obout:Calendar ID="Calendar2" runat="server"
DatePickerMode="true"
TextBoxId="TxtFinish"
ShowTimeSelector="true"
TextSelectTime="Set Time">
</obout:Calendar>
<asp:CompareValidator id="CompareValidator1" runat="server"
ControlToCompare="txtDate" cultureinvariantvalues="true" display="Dynamic" enableclientscript="true" ControlToValidate="TxtFinish"
ErrorMessage="Start date must be earlier than finish date" type="Date"
setfocusonerror="true" Operator="GreaterThanEqual" text="The Start date must be set before the finish date"></asp:CompareValidator>
Any help would be gratefully received.
The problem is you are using obout controls which are sometimes temperamental, use normal calender control and do the same as you have done for the compare validator.That should solve the issue