angularjs force uppercase in textbox

前端 未结 14 1710
情歌与酒
情歌与酒 2020-11-30 20:47

I\'ve tried using the uppercase filter but it does not work. I\'ve tried doing it two ways:


<         


        
相关标签:
14条回答
  • 2020-11-30 21:26

    When using bootstrap:

    First approach: Using class text-uppercase

    <input  type="text" class="text-uppercase" >
    

    Second approach: Using style which can be applied with existing class

    <input  type="text" class="form-control" style="text-transform: uppercase;">
    

    Here is my stackBlitz: https://angular-nvd7v6forceuppercase.stackblitz.io

    0 讨论(0)
  • 2020-11-30 21:26

    it is just an alternative , you can use this " text- transform : capitalize ; " in your css and the text entry will be capitalized. unless the user types it in capital letters everywhere.

    it is just an alternative ^^

    0 讨论(0)
提交回复
热议问题