【发布时间】:2018-09-25 19:19:32
【问题描述】:
我的 html 文件中有以下输入:
<input name="password"
id="newPasswordConfirmation"
ng-model="newPasswordConfirmation"
type="number"
inputmode="numeric"
placeholder=""
required
minlength="8"
maxlength="8"
autocomplete="off"
ng-maxlength="8"
autocorrect="off"
autocapitalize="off"
style="-webkit-text-security: disc; text-security: disc;">
我想将输入限制为 8 个 algarisms,但是当我在移动设备 (android) 上输入时,我可以继续输入超过 8 个 algarisms。为什么这不起作用,您如何进行此限制?
【问题讨论】:
-
maxlength仅适用于<input>类型的文本、电子邮件、搜索、密码、电话或网址。但是您可以创建一个指令,在数字输入上模仿maxlength...
标签: javascript html angularjs