Restrict And Input Text To A Specific Language Characters In Angular.js January 21, 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.Baca JugaDatetime From Utc In Local Time FormatWhy Does Queryselector Only Select The First Element And How Can I Fix This?How To Get The Next Obj When Looping In The Django ModelRemember that this is just the front-end validation and I recommend you to validate the user input in the back-end as well. Share You may like these postsHow To Create Random/shuffle Filter Without Infinite Digest LoopNg-repeat Animation Complete CallbackAngularjs, Only Runs Correctly In Firefox Why?How To Change Icon During Dragover/dragenter Html 5 Drag And Drop 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"