[英]In RoR how do I dynamically show and limit the number of characters allowable?
For example, the comments in SO shows the number of allowable characters remaining. 例如,SO中的注释显示了剩余的允许字符数。 Basically, how do I do that in ruby on rails?
基本上,我该如何在红宝石上做到这一点?
This can be done on JavaScript side, as mentioned in comment. 如注释中所述,这可以在JavaScript方面完成。
This page provides nicely explained example: Interactive character limit for textarea using jQuery (it also contains an example of doing it without jQuery). 该页面提供了一个很好解释的示例: 使用jQuery进行textarea的交互式字符限制 (其中还包含一个不使用jQuery的示例)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.