我在驗證電話號碼時遇到問題。電話號碼是應該在三個輸入字段 第一個輸入字段中填入一個10位數的字串 - 僅只有3位(需要,只能接受數字和最大長度3) 第二輸入字段 - 只只有3個數字(要求,只能接受數字和最大長度3) 第3個輸入字段 - 只有4位數字(要求,只能接受數字和最大長度爲4)電話號碼驗證Angularjs
和選項卡應移動到下一個輸入字段,的字符在第一個 得到執行時,沒有上述條件不能滿足
<label for="phoneone" aria-label="Enter First 3 digits of your phone no."><input id="phoneone" type="number" required name="phoneone" class="phone-text-box" ng-model="user.phoneNumbercodeone" ng-minlength="3" ng-maxlength="3" maxlength="3" ng-pattern="/^[0-9]*$/"></input></label>
<label for="phonetwo" aria-label="Enter second 3 digits of your phone no."><input id="phonetwo" type="number" required name="phonetwo" class="phone-text-box" ng-model="user.phoneNumbercodetwo" ng-minlength="3" ng-maxlength="3" maxlength="3" ng-pattern="/^[0-9]*$/"></input></label>
<label for="phonethree" aria-label="Enter last 4 digits of your phone no."><input id="phonethree" type="number" required name="phonethree" class="phone-text-box" ng-model="user.phoneNumbercodethree" ng-minlength="4" ng-maxlength="4" maxlength="4" ng-pattern="/^[0-9]*$/"></input></label>
<div class="clearfix" ></div>
領域應該是紅色,
我將如何實現使用輸入HTML標籤
如果你只是想通過HTML標記來驗證應該是這個樣子'' – aahhaa
我嘗試了幾個條件,但它不適合我。該模式應該只匹配數字以及 – nikitha
分享你到目前爲止嘗試的 –