The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Word counter while posting?

3 posters

Go down

Word counter while posting? Empty Word counter while posting?

Post by iTzLawliet February 16th 2014, 6:28 am

I know that there are codes for word counters in the widgets but I need one for in the actual forums while a user is posting. As they type their post, they are able to see just how many words they have typed so far before they post. Is there a code for this?
iTzLawliet
iTzLawliet
Forumember

Female Posts : 32
Reputation : 1
Language : English

Back to top Go down

Word counter while posting? Empty Re: Word counter while posting?

Post by Tonight February 16th 2014, 7:01 am

Code:
$(function () {  var n="0";iframe = $('.sceditor-container iframe'); $('#text_editor_textarea').before('Characters Written: <span id="characters">'+n+'</span>');$("#textarea_content").on('keyup',function () {var  a =  $(".sceditor-container textarea");var b = $('#characters');var c = a.val().length;b.html(c);   if(a<1)b.html('0');    });$('body',iframe.contents()).on('keyup',function(){  var  a =  $('body',iframe.contents());  var b = $('#characters');  var c = a.text().length;  b.html(c);     if(a<1)b.html('0');});});
Tonight
Tonight
Forumember

Male Posts : 312
Reputation : 80
Language : Estonian, English, Russian
Location : Estonia

Back to top Go down

Word counter while posting? Empty Re: Word counter while posting?

Post by iTzLawliet February 16th 2014, 2:55 pm

Is that supposed to go in the CSS? Because I tried that and it said that it was invalid coding...
iTzLawliet
iTzLawliet
Forumember

Female Posts : 32
Reputation : 1
Language : English

Back to top Go down

Word counter while posting? Empty Re: Word counter while posting?

Post by SLGray February 16th 2014, 4:23 pm

Administration Panel > Modules > HTML/JavaScript > JavaScript Management
Make sure that it activated. Create a new JavaScript and check the box for in topics.


Word counter while posting? Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51464
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum