Restrict And Input Text To A Specific Language Characters In Angular.js March 09, 2024 Post a Comment i am building a form using angular.js. my form looks like: <input type="text" name="firstName" ng-model="register.firstName" placeholder="שם פרטי" required ng-pattern="pattern"></div> function ctrl($scope) { $scope.pattern = /[\u0590-\u05FF]+/g; } CopyHere is the demoSolution 2: I think Regex is the way to go. HTML5 has the new pattern attribute that you could use to validate the user input, the only problem is that you also have to take care of browsers that do not support it, with Angular you can use the ngPattern directive.This question will help you with the regex.Remember that this is just the front-end validation and I recommend you to validate the user input in the back-end as well. Share Post a Comment for "Restrict And Input Text To A Specific Language Characters In Angular.js"
Post a Comment for "Restrict And Input Text To A Specific Language Characters In Angular.js"