JSFiddle - React, Tailwind, and code Playground
by Adam Doherty
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myController">
<div class="col-sm-5 form-inline">
<input name="RefBox1" type="text" class="form-control" id="RefBox1" style="width: 40px;" type="text" maxlength="2" ng-model="updateRef1" restrictinput="[^0-9\s]" ng-change="checkField(updateRef1, 2)" required/> -
<input name="RefBox2" type="text" class="form-control" ng-change="checkField(updateRef1, 2)" id="RefBox2" style="width: 40px;" type="text" maxlength="2" ng-model="updateRef2" restrictinput="[^0-9\s]" required/> -
<input name="RefBox3" type="text" class="form-control" ng-change="checkField(updateRef1, 2)" id="RefBox3" style="width: 40px;" type="text" maxlength="2" ng-model="updateRef3" restrictinput="[^0-9\s]" required/>
</div>
</div>
JavaScript
var app = angular.module('myApp', []);
app.controller('myController', function ($scope) {
$scope.checkField = function (field, length) {
console.log(field);
//if (field.length == length) {}
};
});