html - ng-maxlength $error message not showing -
using ng-maxlength="80" in <input>
field.
expected this:
<span class="select2-container text-error resize" ng-show="myform.samplename.$error.maxlength">this can't longer 80 characters.</span>
to show if <input>
field has more 80 characters.
however, error message not show. input field gets red border. nothing else.
here part of form:
<form name="myform" class="form-horizontal" ng-show = "isformactive()" novalidate> <div class="control-group"> <label class="control-label buffer-right"><h5>name:</h5></label> <div class="input-prepend buffer-left"> <span class="add-on"><i class="icon-pencil"></i></span> <input type="text" name="samplename" ng-model="person.name" ng-minlength="1" ng-maxlength="80" placeholder="enter comments here" required /></br> <span class="select2-container text-error resize" ng-show="myform.samplename.$error.maxlength"> can't longer 80 characters.</span> </div> </div> </form>
Comments
Post a Comment