Here's my issue, I have the following code:

$("description").observe('keyup', function(event){ text_counter
(500).bind(this); });

function text_counter(max_length){
    var length = this.value.length;
    if (length > max_length){
        this.value = this.value.substring(0,max_length);
                length = max_length;
    $("_count").innerHTML = (max_length - length) + '
characters remaining';

Pretty simple, but I'm having a problem with "this" in the function
text_counter. For some reason "this" points to "object Window". Maybe
I'm just misunderstanding the bind() function, but from what I've read
this should work.

Much thanks for any help.
You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to