dd/mm/yyyy Format In regular Expression (optional mm,optional dd)
([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.][0-9]{4}$
mm/dd/yyyy (optional mm,optional dd)
^([1-9]|0[1-9]|1[012])[- /.]([1-9]|0[1-9]|[12][0-9]|3[01])[- /.][0-9]{4}$
mm/dd/yyyy (Exact Format)
^([01]\d)/([0-3]\d)/(\d{4})$
<asp:TemplateField HeaderText="Cheque Date">
<ItemTemplate>
<asp:TextBox ID="txtPDate" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator id="RegularExpressionValidator1" ControlToValidate="txtPDate" runat="server" ValidationExpression="([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.][0-9]{4}$"
ErrorMessage="Not Valid Date"></asp:RegularExpressionValidator>
</ItemTemplate>
</asp:TemplateField>
([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.][0-9]{4}$
mm/dd/yyyy (optional mm,optional dd)
^([1-9]|0[1-9]|1[012])[- /.]([1-9]|0[1-9]|[12][0-9]|3[01])[- /.][0-9]{4}$
mm/dd/yyyy (Exact Format)
^([01]\d)/([0-3]\d)/(\d{4})$
<asp:TemplateField HeaderText="Cheque Date">
<ItemTemplate>
<asp:TextBox ID="txtPDate" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator id="RegularExpressionValidator1" ControlToValidate="txtPDate" runat="server" ValidationExpression="([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.][0-9]{4}$"
ErrorMessage="Not Valid Date"></asp:RegularExpressionValidator>
</ItemTemplate>
</asp:TemplateField>
No comments :
Post a Comment