I have dates generated by a Javascript enhanced textbox in the format dd/mm/yyyy, which when validated with a asp:comparevalidator fails to to validate correctly.
Here is the relevant code:
<asp:CompareValidator ID="CompareValidator4" runat="server"
ControlToValidate="txtEndDate" ValueToCompare="txtStartDate"
Display="None"
ErrorMessage="End Date should be greater than or equal to Start Date."
Type="Date" Operator="GreaterThanEqual" SetFocusOnError="True">
</asp:CompareValidator>
<strong>Start Date</strong><asp:TextBox ID="txtStartDate" runat="server" Width="215px" CssClass="textfield" Style="width: 176px; margin-left:5px;"></asp:TextBox>
<strong>End Date</strong><asp:TextBox ID="txtEndDate" runat="server" Width="215px" CssClass="textfield" Style="width: 176px; margin-left:5px;"></asp:TextBox>
In case it isn't clear I want the date in txtStartDate to be earlier than the one in txtEndDate.
When validated, I get gibberish results with no obvious pattern to when the validation fails. Can anyone see what is wrong?
btw I am aware of how poor the html is - I am editing someone else's code.