0

Is there any way to enforce capital letters on a form field, in Angular TypeScript?

For example, I have a request for a field "Name" that accepts capital letters only.

Eduard
  • 3,395
  • 8
  • 37
  • 62
amahiou
  • 1
  • 1
  • Possible duplicate of [How to autocapitalize the first character in an input field in AngularJS?](https://stackoverflow.com/questions/15242592/how-to-autocapitalize-the-first-character-in-an-input-field-in-angularjs) – ThreeCheeseHigh Nov 29 '19 at 09:44

1 Answers1

0

You can make uppercase using text-transform: uppercase :

<input style="text-transform: uppercase" type="text" />

As mdn says: :

The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. It also can help improve legibility for ruby.

StepUp
  • 36,391
  • 15
  • 88
  • 148