T
tshad
I have been trying to set up a range validator and regular expression for my
dates.
I tried this:
<asp:RangeValidator runat="server"
ControlToValidate="AbsentFrom1"
MinimumValue="12/31/1950"
MaximumValue="1/1/2100"
Type="Date" text="Invalid Date"/>
Which doesn't seem to work at all.
I put in 1/15/1940 and it didn't give me an error.
I need this because my regular expression won't handle leap years and I
don't want to have to deal with different type of years over and about 2 or
4 characters. My RegularExpressionValidator (which does work) is:
<asp:RegularExpressionValidator ControlToValidate="AbsentFrom1"
ValidationExpression="^(([1-9])|(0[1-9])|(1[0-2]))\/(([1-9])|(0[1-9])|(1[0-9
])|(2[0-9])|(3[0-1]))\/((\d{2})|(\d{4}))$" Display="Dynamic" Text="<br>From
Date Invalid or in wrong Format(MM/DD/YY)" runat="server"/>
Why doesn't the range validator work?
Is there a better way to validate my dates?
Thanks,
Tom
dates.
I tried this:
<asp:RangeValidator runat="server"
ControlToValidate="AbsentFrom1"
MinimumValue="12/31/1950"
MaximumValue="1/1/2100"
Type="Date" text="Invalid Date"/>
Which doesn't seem to work at all.
I put in 1/15/1940 and it didn't give me an error.
I need this because my regular expression won't handle leap years and I
don't want to have to deal with different type of years over and about 2 or
4 characters. My RegularExpressionValidator (which does work) is:
<asp:RegularExpressionValidator ControlToValidate="AbsentFrom1"
ValidationExpression="^(([1-9])|(0[1-9])|(1[0-2]))\/(([1-9])|(0[1-9])|(1[0-9
])|(2[0-9])|(3[0-1]))\/((\d{2})|(\d{4}))$" Display="Dynamic" Text="<br>From
Date Invalid or in wrong Format(MM/DD/YY)" runat="server"/>
Why doesn't the range validator work?
Is there a better way to validate my dates?
Thanks,
Tom