angularjs force uppercase in textbox

前端 未结 14 1806
情歌与酒
情歌与酒 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:18

    The idea is to show (not transform) the string as uppercase at client side and transform into uppercase at server side (users can always control what happens at client side). So:

    1) in the html:

    
    

    here no uppercase transformation.

    2) in the css:

    #test {text-transform: uppercase;}
    

    data is shown as uppercase, but actually still lowercase, if user typed in lowercase. 3) turn the string into uppercase at server side when inserting into database.

    = = = = = for playing around, can try follow:

    
    
    

    but I think ng-change or ng-blur ways are not necessary for your case.

提交回复
热议问题