Restricting text box inputs to a given regexp using jQuery

前端 未结 4 2025
被撕碎了的回忆
被撕碎了的回忆 2020-12-20 07:23

Consider the following text box:


Using jQuery I want to restrict the

4条回答
  •  温柔的废话
    2020-12-20 08:12

    Define a global variable "oldVal" (not described below), which contains the last known good value. Bind to the keydown action for the input field:

    
    

    This should get you started

提交回复
热议问题