Home > Web Front-end > JS Tutorial > angularjs+ionic registration page form verification

angularjs+ionic registration page form verification

PHPz
Release: 2017-03-12 15:59:14
Original
2061 people have browsed it

On the registration page where tabs and routing have been createdhtml:

Function:

  • After verification of the mobile phone number and password format, the judgment of whether the two password inputs are the same is correct and the checkbox can be clicked to register and enter. tabs.mypage page.

  • Not performedVerification codeReally send, obtain the background verification code data and compare it with the input verification code.

Use:

Note:Do not add click events in the

                                                                  手机号                                                                            输入密码                                                                            确认密码                                                                            验证码                                                                                                                   手机号输入有误             密码输入格式有误         两次密码输入不一致                                    同意发货么用户协议                           注册
Copy after login

controller

js in route binding:

Function: Click to trigger to obtain the verification codeFunction, no request can be sent again during the 59s countdown.

Note: Remember to inject $interval# in the controller

##
 1     $scope.canClick=false; 2     $scope.description="获取验证码"; 3     var second=59; 4     var timerHandler; 5     $scope.getTestCode=function(){10         timerHandler=$interval(function(){11             if(second<=0){12             $interval.cancel(timerHandler);13             second=59;14             $scope.description="获取验证码";15             $scope.canClick=false;16         }else{17             $scope.description=second+"s后重发";18             second--;19             $scope.canClick=true;20         }21             },1000)22     };
Copy after login


The above is the detailed content of angularjs+ionic registration page form verification. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template