Validation which accept( empty , numeric or Float values)
Now we have to discuss about the validationexpression ie:
the textbox should accept empty values , numeric ( float ) .
Implementation Code :
^\d*\.?\d*$
HTML
Matches
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="Invalid format" ControlToValidate="TextBox3" ValidationExpression="^\d*\.?\d*$" ValidationGroup="d"></asp:RegularExpressionValidator>
<asp:Button ID="Button5" runat="server" Text="Button" ValidationGroup="d" />
( ) -> empty value
4535
520.20
2.54
Non-Matches
21.0dfdf
47854
Rpks
Read more »