Bootstrap - How to use validation states on <textarea>

Bootstrap allows you to state states for input inside forms using class="form-group has-error" . But this does not work with <textarea> , and, oddly enough, and help-inline , any help?

Edit: This is a complete input group:

 <div class="form-group"> <label for="desc" class="col-sm-2 control-label">Description:*</label> <div class="col-sm-10"> <textarea autocomplete="off" class="form-control" rows="5" name="desc" id="desc"></textarea> </div> </div> 
+5
source share
1 answer

You can add the form-control class to the textarea element.

Example here

 <div class="form-group has-error"> <textarea class="form-control"></textarea> </div> 

The selector used for this is .has-error .form-control . Here is the default style:

 .has-error .form-control { border-color: #a94442; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); box-shadow: inset 0 1px 1px rgba(0,0,0,.075); } 
+4
source

Source: https://habr.com/ru/post/1204148/


All Articles