Stack Exchange
how to limit the length of a angularjs input fiield
I have the following code and the captcha field need to be only say 10 characters. As is the length seems to be endless.
I wanted the webpage field for the captcha to be only say 7 characters only.
<div class=" col-sm-4 ">
<div id="myapp"  ng-controller="subscribe_controller">
<h4 style="color:black;" >Subscribe</h4>
<form id="subscribe_01">
<h4>
    <p ng-bind="msg2"></p>
    <input id="email2"   style="color:gray;" type="text" name="EMAIL" placeholder="Your Email Adddress" value="" ng-model="email2"></h4>
    <input id="token2"   class="w3-input w3-section"   type="hidden" name="token2"       value="<?php echo $token;?>" >
    <p>Code :<input id="captcha"     type="text"   placeholder="" required name="captcha" value="" ng-model="captcha" length="7" aw-limit-

length="3"><p>
    <button class="w3-button w3-black" ng-click="postData_subscribe()" id="buttoncontact_subscribe">Send To Subscribe</button></p>
</form>
</div

>

I think the property is maxlength not just length. Try changing it to maxlength="7".

Is was size. Thanks

I was the size option, so may ng-min ng-max .etc. but it was the old size
