Validation on text on alphabets enter

user4033545 picture user4033545 · Oct 8, 2014 · Viewed 46.5k times · Source

Any one use AngulerJS Validation on TextBox. So that only enter alphabets.

Answer

Lowe Bäckström picture Lowe Bäckström · Oct 8, 2014

Depending on what you want:

Alphabets and blankspace:

ng-pattern="/^[a-zA-Z\s]*$/"

Alphabets no blankspace:

ng-pattern="/^[a-zA-Z]*$/"