How to change the input to uppercase as it is being typed

前端 未结 5 1420
盖世英雄少女心
盖世英雄少女心 2020-12-16 03:08

I am using onkeyup=\"this.value=this.value.toUpperCase();\"to change input text value in uppercase. This is working but my need is to change a single letter in

5条回答
  •  感情败类
    2020-12-16 04:04

    Like kristoffer says, probably best to use the style, and convert serverside. There's also a jQuery plugin to force uppercase: http://plugins.jquery.com/plugin-tags/uppercase

    
        
            
            
        
        
            
    Fld 1 : browser shows upper-case, form submits mixed-case

    Fld 2 : javascript updates text to uppercase, form submits uppercase

提交回复
热议问题