文本框的最大长度不起作用 [英] maxlengh of textbox not working
本文介绍了文本框的最大长度不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果设置textbox1 MaxLength = 20,并且我仍然可以输入印地语字符超过20个字符.
if set textbox1 MaxLength =20, and i can still input hindi character More than 20 characters.
推荐答案
尝试执行此操作
Try doing this
(' input#title').attr(' maxLength',' 25').keypress(limitMe); 函数limitMe(e){ 如果(例如e.keyCode == 8 ){>返回 true ; } 返回 此.值 .length <
('input#title').attr('maxLength','25').keypress(limitMe); function limitMe(e) { if (e.keyCode == 8) { return true; } return this.value.length <
( this ).attr( maxLength"); }
(this).attr("maxLength"); }
这篇关于文本框的最大长度不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文