I do not know if it will work with WYSIWYG, in fact, i doubt it if it's not a standard textarea, and i don't know much about WYSIWYG so it may add the text formatting tags as well. That's a whole new agenda lol
Ok, quick tutorial. I'm assuming you all know how to add the header code in each page served that this functionality will appear on, so we'll move on:
The first thing you need to know is that EACH counter/textarea relationship MUST have it's own unique identifier. This means that each textarea should have a unique "name". Real forms do this anyway so you shouldn't have to worry.
So, to add this functionality to any textarea, you will need to modify the "textarea" tag according to the following example configured to allow 125 characters maximum
PHP Code:
<textarea class="bginput" name="MYFORMNAME" cols="28" rows="4" onKeyDown="textCounter(MYFORMNAME,this.form.remLen,125);" onKeyUp="textCounter(MYFORMNAME,this.form.remLen,125);">
And finally, to populate the counter and make it work ONLY with its corresponding textarea, modify it like this:
PHP Code:
<input readonly class="bginput" name="remLenMYFORMNAME" size="4" value="125">
That should be it