Prevent user from typing in input at max value

前端 未结 7 1953
遥遥无期
遥遥无期 2020-12-30 04:41

I\'d like the user to be blocked from typing more if the value is over 100. So far I have the following from reading different posts:

$(\'.equipCatValidation         


        
7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-30 05:26

    Maybe keydown instead of keyup?

    
    
    
      
    
      
    
    
    
    
    
    
    
    
    

    EDIT: There is a valid comment here - Prevent user from typing in input at max value - to circumvent that you should probably store the previous value and restore it when necessary.

提交回复
热议问题