Kalaiyarasi M Kalaiyarasi M - 1 year ago 152
HTML Question

Need ng pattern which allows only alphabets space and point or dot(.)

I need to use an ngPattern which will allow only alphabets, space and point or dot(.) in Angularjs.

Answer Source
<input type="text" ng-model="model" id="input" name="input" ng-pattern="regex" /><br>

 angular.module('ngPatternExample', [])
    .controller('ExampleController', ['$scope', function($scope) {
      $scope.regex = '/^[a-zA-Z\s\.]*$/';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download