I need a counter counting the letters you type in a textarea. And I need the counter to count AS you type.

I have tried the SITF and it works just fine for 1-line textfields (eg input type=text). It does transform in to textareas as the normal TextField does, when theres more than one line.

I have tried to inject native js to inject a onkeypress event handler to my textarea. But I cant make it work.

Any ideas?

I guess your best bet is to extend SITF to support multiline fields or extend of the normal TextField to send back the number of characters in the field. Either way, GWT coding is a necessity.

Do you know if theres any plans of making onkeypress a part of the TextField component?

There’s always the all-wonderful
Client-Side Validated TextField
, which supports displaying a message from a JS validator. It can be used for displaying a counter (and a countdown) and the examples have a number of ready scripts.

See the
on-line demo
. It supports both multi-line text areas as well as single-line and password fields. RichTextArea is not supported.


Haven’t discovered that one. Seems to be perfect for my purpose.
I’ll check it out

Thanks a lot

From now on you are my hero Marko.

Worked almost one hold day investigating possibilities

It works exactly the way I need

Thank you