How to force input to only allow Alpha Letters?

后端 未结 9 1549
长发绾君心
长发绾君心 2020-12-01 06:52

using jQuery here, however unable to prevent numbers from being typed into the input field

http://codepen.io/leongaban/pen/owbjg

Input



        
9条回答
  •  余生分开走
    2020-12-01 07:18

    If your form is PHP based, it would work this way within your "

        'onkeypress' => 'return /[a-z 0-9]/i.test(event.key)', 
    

提交回复
热议问题