如何防止用户使用jquery在文本框中键入非常长的字符串 [英] How to prevent user to type very long string in textbox using jquery
本文介绍了如何防止用户使用jquery在文本框中键入非常长的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望用户不防止在asp.net文本空间e.gaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa进入很长字。在文本框中我有很多单词,但不是长字,因为在保存后我显示在转发器中并且它正在扩展我的转发器,因为无法处理的字符串不能被包裹
如何使用jquery执行此操作。是否可以在30个字符后自动添加空格?
I want the user to prevent entering very long word without space e.g 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in asp.net textbox. There my be many words in the textbox but not suxh long word because after saving i display that in repeater and its is expanding my repeater becausethe unspaced string can't be wraped
How to do this with jquery. Is it possible to add a space automatically after 30 character in such word?
推荐答案
我认为你应该换行而不是限制。请参阅 - 包皮过长的网址,并用CSS [ ^ ]
I think you should wrap instead of restricting. Refer - Wrapping Long URLs and Text Content with CSS[^]
这篇关于如何防止用户使用jquery在文本框中键入非常长的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文