1

i have a register form inside i want users to insert their first name and last name only in hebrew letters.

this is my ng-pattern:

$scope.onlyHebrewPattern = /[\u05D0-\u05F3]+/g;

this is my input type:

<input type="text" ng-disabled="disableButtons" name="firstname" ng-minlength="2" ng-maxlength="15" ng-model="register.firstName" placeholder="firstname" ng-pattern="onlyHebrewPattern" required title="please enter your name">

then in my controller i go and check:

if (!registerForm.firstname.$valid)

and if it true i will prompt an error message.

for most cases this will work but there are cases that it won't work for like this input:

לגחדךלכsddski it will not trigger an invalid in the form.

i just can't understand what's wrong. i suppose something with my pattern?

thanks.

lobengula3rd
  • 1,821
  • 4
  • 26
  • 39
  • may be because `לגחדךלכsddski` is not "only hebrew"? – Ivan Chernykh Sep 17 '13 at 06:12
  • i have edited my question. if i put this input i will not get an $valid error in my form when actually i should get an error – lobengula3rd Sep 17 '13 at 06:24
  • Here is an answer to a similar question : http://stackoverflow.com/questions/19392528/undesirable-result-of-use-of-ng-pattern-angular-js-with-unicode-characters – Refael Aug 16 '15 at 10:05

0 Answers0