[Javascript] Q on interuppting char entry

Chris Tifer christ at saeweb.com
Mon Apr 14 07:45:25 CDT 2003


> 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.

To do this, you have to return false on the keypress which keeps the
character from being entered. From the looks of it, you're checking the
length, determining if it's too long, THEN removing it.  Thus the quick
appearance
and then disappearance.

Chris Tifer
http://emailajoke.com



More information about the Javascript mailing list