user5858 user5858 - 1 year ago 73
HTML Question

Unable to locate the event handler

I've this html source of this url:
. 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:

In the login textfield if I delete last two characters "
" by pressing Backspace leaving login to "aaaaaaaaaa@gmail.c" then Sign In automatically gets disabled.

Login field code

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="" 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">

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>

Now I've searched
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?

Answer Source

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


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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download