Here's my issue, I have the following code: $("description").observe('keyup', function(event){ text_counter (500).bind(this); });
function text_counter(max_length){ alert(this); var length = this.value.length; if (length > max_length){ this.value = this.value.substring(0,max_length); length = max_length; } $(this.id+"_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 & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---