我正在尝试验证单个输入以检查数字1-99,我想知道是否可以将它包装成表格就可以按角度进行。如果需要表单,这不是问题,只是好奇是否需要表单。这是我正在尝试的-
<div class="errorMulti" ng-show="multiAdd.$error.maxlength">Error</div>
<input type='text' ng-model="multiAdd" placeholder='Number of levels to add 1-99' ng-maxlength="2">
很简单,但似乎没有用。有见识吗?谢谢!
<div ng-app>
<form name="myform">
<div class="errorMulti" ng-show="myform.multiAdd.$error.maxlength">Error</div>
<input type='text' name="multiAdd" ng-model="multiAdd" placeholder='Number of levels to add 1-99' ng-maxlength="2">
</form>
</div>
检查JSfiddle:http : //jsfiddle.net/15ugz6j3/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句