TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sourav Agarwal
NA
11
5.4k
RegEx to validate leap year date format MM/DD/YY
Mar 2 2016 10:05 AM
I am looking for a regular expression to validate date format mm/dd/yy (including leap year). Below is a sample code that mask dates in the format MM/DD/YY. This code doesn't validate leap year dates like 02/29/16.
Kindly help me find a solution. Thanks a lot in advance!
<asp:TextBox ID="txtRpt" runat="server" Text='<%# Bind("Rpt", "{0:MM/dd/yy}") %>'></asp:TextBox>
<asp:MaskedEditExtender ID="meTxtRpt" runat="server" TargetControlID="txtRpt" Mask="99/99/99" MaskType="Date"></asp:MaskedEditExtender>
<asp:MaskedEditValidator ID="mevTxtRpt" runat="server" ValidationExpression="^[0-9]{1,2}/[0-9]{1,2}/[0-9]{2}$" ControlExtender="meTxtRpt" ControlToValidate="txtRpt" ValidationGroup="pnll1" InvalidValueMessage="Enter valid date<br /> e.g. mm/dd/yy" Display="None"></asp:MaskedEditValidator>
<asp:ValidatorCalloutExtender ID="vceTxtRpt" runat="server" TargetControlID="mevTxtRpt" Enabled="True"></asp:ValidatorCalloutExtender>
Reply
Answers (
2
)
dash board or landing page
free templates