user1650978 user1650978 - 1 year ago 97
Javascript Question

AngularJS - call function after text field completion

I have a text field as

<input type="text" class="form-control" id="inputID" name="inputName" ng-model="inputUserName" ng-required="true" autofocus="true"/>

Once I input the text value and say, press Tab, or move on to the next field, I want to call a function which basically takes the input value and sends it to my server API to perform a validity check. How can I achieve this?

Answer Source

use the ng-blur:

<input type="text" ng-blur="method()">

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