How to add validation on textbox control, vb.net regular expression, required input for textbox


The following uses a textbox and the regularExpressionValidator control in asp.net to validate the requirements of user entered data. The control works but has a few problems on mobile devices and renders differently across platforms.
 
<asp:TextBox type="text" ID="txtBxMailZipCode" runat="server" CssClass="form-control form-control-50" required="true"></asp:TextBox>
                                                            
<asp:RegularExpressionValidator Display = "Dynamic" ControlToValidate = "txtBxMailZipCode" ID="RegularExpressionValidator3" ValidationExpression = "^[\s\S]{5,8}$" runat="server" ErrorMessage="Minimum 5 and Maximum 8 characters required."></asp:RegularExpressionValidator>
 
 
 
 
 
 
Tags: validation
Last update:
2014-12-03 21:37
Author:
Mark
Revision:
1.0
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags