Limit maximum number of characters in Topic Content TextArea
-
I want to limit the number of characters in the Topic Content Text Area in bbPress to a maximum limit (of say 500 characters). How can I do it?
I tried to do it by using the maxlength attribute of textarea (bbp_topic_content) in the stylesheet file, but this attribute is not working (may perhaps be because this attribute was included in HTML5 version only). However, if I use this in Developer Tools in Chrome while inspecting the text area for Topic Content, it works fine; but that is only for testing and I am not able to make a permanent change by editing the source file or through any plugin.
Other two methods could be javascript to check on local machine the number of characters being entered, but I understand that this can easily be cheated by disabling javascript. Moreover, I am not fully sure how to do it.
Third method could be to use for action or filter hook. Can you please suggest me which hook to be used and sample code, if any?
Thanks in advance.
- You must be logged in to reply to this topic.