Hi everybody!

Im getting an error with RangeValidator. Its simply and very strange. Im validating a text field that gets a date. The minimun value is "1900/01/01" and the maximum value is "2010/12/31".

The error occurs when I insert the date "1987/10/18". All other dates are accepted (well, those i tested).

Here is the simple code:

<html>
<head>
<title></title>
</head>
<body>

<div>
Enter the date of birth:
</div>

<div>
<form runat="server">
<asp:RangeValidator runat="server" ControlToValidate="txtBirthDate" MinimumValue="1900/01/01" MaximumValue="2010/12/31"
                                    Display="Dynamic" Type="Date">Wrong Data</asp:RangeValidator>

<asp:TextBox id="txtBirthDate" runat="server" MaxLength="10"/>
</form>
</div>

</body>
</html>

Anyone know what is happening?


Thx a lot!

It seems to me the date format you are using: Try 1987/18/10. If that works then you the date format on you machine is yyyy/dd/mm.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.