本文介绍了无法找到事件处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为此网址 : https://login.freecharge.in/login?callbackurl=https://checkout.freecharge.in/payment 。该页面有两个输入字段 - 登录&密码。

I've this html source of this url: https://login.freecharge.in/login?callbackurl=https://checkout.freecharge.in/payment. This page has two input fields - login & password.

当我们输入登录名和密码时,我想找到正在调用的处理程序。例如,当我输入这两个值时,登录按钮被启用:

I want to locate the handler being called when we key-in the login and password. For example when I type these two values then Sign In button gets enabled:

[email protected]
password11233455

在登录文本字段中,如果我删除了最后两个字符<$ c $通过按退格键登录到[email protected],然后登录自动禁用。

In the login textfield if I delete last two characters "om" by pressing Backspace leaving login to "[email protected]" then Sign In automatically gets disabled.

登录字段的html代码如下所示:

The html code of the login field looks like this:

<input id="loginEmailMobile" name="loginEmailMobile" autocomplete="loginEmailMobile" type="text" focus-me="vm.focus == 'LOGIN'" focus-delay="200" ng-focus="frmLogin.loginEmailMobile.blured = false" ng-blur="frmLogin.loginEmailMobile.blured = true" required="" ng-model-options="{allowInvalid:true}" ng-model="vm.data.login.emailOrPassword" ng-maxlength="127" ng-pattern="^(([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4})|([6-9][0-9]{9}))$" no-space="" class="ng-valid-maxlength ng-touched ng-dirty ng-valid-parse ng-valid-required ng-invalid ng-invalid-pattern">



登入按钮代码



Sign-In Button code

<button value="Submit" class="submit disable" ng-class="{'disable':frmLogin.$invalid}" id="signInButton" ng-click="vm.signinClickHandler(frmLogin.$valid)"><span id="textLoginSignIn">SIGN IN</span></button>

现在我搜索了 loginEmailMobile 这些文件和我没有发现,除了在这段代码中。那么谁在倾听这个元素并采取行动呢?如何找到它?

Now I've searched loginEmailMobile in all the files and I don't find this except in this code. So who is listening to this element and taking action? How to find it?

推荐答案

这是通过Angular框架完成的,具有以下模式:

This is done via the Angular framework, with the following patter:

ng-pattern="^(([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4})|([6-9][0-9]{9}))$"

这意味着如果输入看起来不像电子邮件,则该字段无效。然后,你没有发布这个代码,但最有可能在按钮上有一些像 ng-enabled =...这样的一个条件来检查email字段是有效的。

It means if the input does not look like an email, the field is not valid. Then, you didn't post this code, but most likely on the button there's something like ng-enabled="..." with a condition that checks if the email field is valid.

这篇关于无法找到事件处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 12:27