Home  >  Article  >  Web Front-end  >  The latest AngularJs verification mobile phone number example sharing

The latest AngularJs verification mobile phone number example sharing

小云云
小云云Original
2017-12-18 11:49:001617browse

This article mainly shares with you the latest example of AngularJs verification of mobile phone number, and the AngularJs verification has been successfully tested, so this article has a good reference value and I hope it can help everyone.

The examples are as follows:

<form name="signUpForm" novalidate>

  <p class="form-group">
  <p class="row clearfix">
   <label for="tel1" class="col-xs-12" style="text-align: left">L张蒙号码1:</label>
   <p style="text-align: center" class="col-xs-12">
    <input id="tel1" type="tel" name="tel1"
        data-ng-model="vm.tel1"
        ng-minlength="11"
        ng-pattern="/^1[3|5][0-9]\d{4,8}$/" required
        style="width: 80%;font-size: large"
        placeholder="请输入号码1:"/>
   </p>
   <p class="col-xs-12">
    <p class="glyphicon glyphicon-ok input_result text-success"
      ng-if="signUpForm.tel1.$valid"></p>
    <p class="text-danger glyphicon glyphicon-remove"
      ng-if="signUpForm.tel1.$error.required&&signUpForm.tel1.$touched">电话不能为空!</p>
    <p class="text-danger glyphicon glyphicon-remove"
      ng-if="(signUpForm.tel1.$error.minlength||signUpForm.tel1.$error.maxlength||signUpForm.tel1.$error.pattern)&&signUpForm.tel1.$touched">请输入有效手机号!</p>
   </p>
  </p>
</form>

How has everyone learned? Everyone, please try it quickly.

Related recommendations:

How jQuery uses regular expressions to verify mobile phone numbers, ID numbers, and Chinese names

javascript - Regular Verification Problem with mobile phone number

JS method sharing for verifying mobile phone number_javascript skills

The above is the detailed content of The latest AngularJs verification mobile phone number example sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn