Forcing form text to be lower-case

前端 未结 11 1180
面向向阳花
面向向阳花 2021-02-02 10:16

How could I force the text in the \"username\" text input to be lower-case regardless of what user types?

11条回答
  •  温柔的废话
    2021-02-02 11:15

    You have to use javascript. I have an example here: http://jsfiddle.net/xCfdS/3/

    HTML:

    Javascript:

    function forceLower(strInput) 
    {
    strInput.value=strInput.value.toLowerCase();
    }​
    

提交回复
热议问题