[Javascript] Q on interuppting char entry

Walter Torres walter at torres.ws
Fri Apr 11 17:32:56 CDT 2003


Thanks, but 2 things...

1) This looks like an overall document/window event catcher

   I'm just trying to grab this on specific FORM Elements,
   TEXTAREA to be exact

2) All I want to do is throw away and characters entered into
   my target TEXTAERA once it reaches its MAXLENGTH setting,
   which is a new attribute I want to add to the Element.

My desire is for a coder to add MAXLENGTH = [x > 0] and then INCLUDE some
piece of code at the end of his document and all the magic will happen to
enforce this MAXLENGTH. But Only on TEXTAREAs that have a MAXLENGTH defined.

I have all the code to:
 - parse all TEXTAREAS on a document
 - discover if a MAXLENGTH is defined and if it is larger than ZERO
 - get length of value
 - compare it to MAXLENGTH value
 - replace value with only set character count

But the last character entered flashes. I'm trying to no have that happen.

Thanks

Walter



More information about the Javascript mailing list