Skip to content
Loading
How to validate texbox using asp.net bootstrap error?  
  •   
  • div class="input-group mb-2">  
  •                       class="input-group-append">  
  •   
  •                         
  •                       class="input-group col-md-4 col-md-offset-2 col-sm-2 col-xs-2">  
  •                           class="input-group pull-right">  
  •                                                             
  •                               @Html.TextBoxFor(m => m.Code, new  
  •                               {  
  •                                   @class = "form-control",  
  •                                   type = "text",  
  •                              id = "postal code",  
  •                                   autofocus = "autofocus",  
  •                                   placeholder = "Postal / Zip Code",  
  •                              required = "required",  
  •                              pattern = @"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$",  
  •                             title = "This field is required"  
  •                               })  
  •                                
  •                               class="input-group-append">  
  •                                   class="input-group-text">  
  •   
  •                                     
  •                                 
  •   
  •                             
  •                         
  •                     
  •  
     

    6 Replies

    Know the answer? Post it — somebody with the same question will find it here.