我的项目已经完成,对于客户端的要求,我想设置所有文本框的maxlength,这是更改所有文本框的一个大问题。所以我使用Tagmapping来设置maxlength。这是一个长度大于给定长度的工作。例如。我将标记映射类中的最大长度设置为10。但是这可以使文本框设置为大于10,其余的文本框默认设置为0.所以那些文本框没有设置10.如何解决这个问题。
解决方案您好, 您可以使用jQuery更新文本框的maxlength属性吗? (document).ready(function() {
(。textBoxClassName)。attr(''maxlength'','' 10''); });
尝试上面的代码,这可能对你有用。这只是猜测,因为我还没试过。 祝你好运 -Amit
Hi, My project is finished, For the client requirement, I want to set the maxlength for all the textboxes, that is a big problem to change all the textboxes. so I m using Tagmapping for set the maxlength. It is work which one length is greater then the given length. For example. I set the max length in my tag mapping class to 10 only. But this is worked which textboxes is set to greater than 10, rest of the textboxes are defaultly set 0. So those textboxes are not set 10. How to solve this problem.
解决方案 Hi, Can you use jQuery to update maxlength attribute for your textbox ? (document).ready(function() {(".textBoxClassName").attr(''maxlength'',''10''); });Try above code, that may work for you. this is just guess as i have not tried this yet. Best luck -Amit
更多推荐
如何一次将maxlength设置为项目中的所有文本框
发布评论