Limit number of characters in input type number

后端 未结 13 1762
逝去的感伤
逝去的感伤 2020-12-18 08:08

Im trying to limit to X number the characters in a input (type of number). ive tried a lot of options and none seems to work. I dont want to use the option tel as it needs t

13条回答
  •  被撕碎了的回忆
    2020-12-18 08:33

    Dude why go for javascript? Just try

    
    

    maxlength will anyways define a maximum length for the input field.

    Hope this solved the problem :)

    EDIT: Since you specifically want numbers, why dont you use the above and then run a jquery validation to check for numbers? That will also work..

    EDIT: Okay, try

    
    

提交回复
热议问题