-1
我需要一個幫助。我有一個文本字段,它將使用angular.js.驗證一些特定的文本。我在下面解釋我的代碼。如何使用angular.js驗證文本字段中的字符
<div class="input-group bmargindiv1 col-md-12">
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">User Role :</span>
<input type="text" name="colgmname" id="resourcerole" class="form-control" placeholder="Add User Role" ng-model="user_role" ng-keypress="clearField('resourcerole');" >
</div>
在上述文本字段,如果用戶將進入特定PRINCPAL/princpal
和HOD/hod
它不會採取並顯示與在場上的紅色邊界的驗證消息。
你有表單驗證呢?什麼是ng-keypress =「clearField('resourcerole');」? – Errorpro
它是在輸入空白字段後刪除邊框顏色。 – subhra