【问题标题】:how to limit the length of a angularjs input fiield如何限制angularjs输入字段的长度
【发布时间】:2019-06-23 03:33:09
【问题描述】:

我有以下代码,验证码字段只需说 10 个字符。因为是长度似乎是无穷无尽的。

我希望验证码的网页字段只能说 7 个字符。

<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

>

【问题讨论】:

  • 我认为该属性是maxlength 而不仅仅是length。尝试将其更改为maxlength="7"
  • 是大小。谢谢

标签: html angularjs forms


【解决方案1】:

我是大小选项,所以可能是 ng-min ng-max .etc。但它是旧尺寸

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-10
    • 1970-01-01
    • 1970-01-01
    • 2020-12-11
    • 2019-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多