Issue #9 new

Disabling english input doesn't really work

Mark Veltzer
repo owner created an issue

We disable english input using the \w+ regular expression. Turns out this is not good enough since, for instance, it allows russian input. What we really want is to only allow hebrew input + ctrl characters.

Comments (3)

  1. Doron Veltzer

    Implement this (from stack overflow)

    You can check the Unicode block for this language here, I guess it is Hebrew, so the code range is 0590-05FF.

    Then you can use ngPattern to do the validation like this:

    <input type="text" name="firstName" ng-model="register.firstName" placeholder="שם פרטי" required ng-pattern="pattern"></div>

    function ctrl($scope) { $scope.pattern = /[\u0590-\u05FF]+/g; }

  2. Log in to comment