How do you automatically set text box to Uppercase?

后端 未结 12 621
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-29 23:50

I am using the following style attribute to set the user input to uppercase so that when the user starts typing in the text box for example railway, then it should

12条回答
  •  旧巷少年郎
    2021-01-30 00:36

    I think the most robust solution that will insure that it is posted in uppercase is to use the oninput method inline like:

    EDIT

    Some people have been complaining that the cursor jumps to the end when editing the value, so this slightly expanded version should resolve that

提交回复
热议问题