How can I determine the number of characters in a post?

naser Naser Posted in General Discussion 2 months ago

Is there a way to apply existing in the pictures?

enter image description here

enter image description here

Replies
ly Naser Naser Replied 3 weeks ago

Roman Lohov
Well done . good job

us Roman Lohov Replied 3 weeks ago

As I'm browsing through forums, here it is. In components/OssnWall/plugins/default/forms/OssnWall/home/container.php

After:

ossn_load_external_js('jquery.tokeninput');  ?>

Add:

<script>
      function countChar(val) {
        var len = val.value.length;
        if (len >= 500) {
          val.value = val.value.substring(0, 500);
        } else {
          $('#charNum').text(500 - len);
        }
      };
    </script>

(or place it in the JS so you can use it in other pages as well)

Before:

<li class="ossn-wall-privacy">

Add:

<li id="charNum"></li>

Now I do not know what is the limit on OSSN wall post characters, i don't care. So, whatever it is, just replace 500 with "Limit set by default"

ly Naser Naser Replied 2 months ago

I apologize for the mistake

enter image description here
https://a.top4top.io/p_1558sbcbp1.png
https://g.top4top.io/p_1558plk4o1.png

German Arsalan Shah Replied 2 months ago

Sorry these images are not appearing here, share a direct link or in the reply below