MyBB Community Forums

Full Version: Insert Word Counter Into Posting Section
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello!

I was just wondering if there was any way to add a code that would insert a word counter to count the words as you type them into the textarea of your post. I think this would be a really awesome feature, and would love it if someone could help me out with it.

I was thinking it wouldn't be too difficult, but I'm not sure. Does anyone think they can let me know what the code would be for this?

Thank you so much!!
For some odd reason i can't use a onchange() event in the textarea =P I've got it working with a button underneath the textarea, but that looks a lil' stupid =P
You need to use onkeyup, LeX-. Smile
CraKteR Wrote:You need to use onkeyup, LeX-. Smile

Will try that right away! =P

Edit ::

Is the textarea manipulated by some jscript onload ? =P Cause no event is working on it, unless you remove the id="message" name="message" of it =P But if you remove this, smilies and inserting a message into the DB will not work Wink
Any more luck on this? ^_^ Thanks for helping!!
The textarea is manipulated by the prototype library (mainly the editor).

Can't remember how it works exactly, but you should be able to dynamically set the event after the editor comes up. Something like:
mytextarea.onKeyUp = function () {alert("test");}

Not sure if the above code is correct.
Hmz =P Thx for the info ! Will try it this evening ! Wink
How's it coming? Did that work for ya? ^_^
Rosaline Wrote:How's it coming? Did that work for ya? ^_^

Nope =P
Can someone else try to do this modification? Please and thank you!
Pages: 1 2