Re: Blocking input into a text area



eggie5@xxxxxxxxx wrote:
I wrote a script that tracks the number of characters a user types
into a text box. It has a limit you can set, and when that limit is
reached I would like to block the user from entering any more text.

How can I block the user from typing characters in the text area?

There is no reliable way prevent the entry of characters using script. There are some scripts which, once the limit has been reached, try to detect on keydown if a character within a certain range has been pressed and cancel it. However you have to allow users use of cursor keys, delete, backspace, etc.

In any case, that method doesn't stop users entering as much text as they like by pasting.

Your best bet is to validate the content when the form is submitted and tell the user that they've put too many characters in the text area. You might also have a keyup handler that shows the users how many characters they have left.

Make sure your server can handle getting any number of characters from the text area.


--
Rob
.



Relevant Pages

  • Re: FWIW: ST Enterprise Cancelled
    ... > through the Guardian while they were playing with it. ... Where in any version of Ellison's script is this? ... LeBeque tells Beckwith that hes not going to keep doing ... >>will not do with their continuing characters and overall storyline, ...
    (sci.space.history)
  • Re: FWIW: ST Enterprise Cancelled
    ... >>charecter...why didn't they just film it the way Harlan wanted them to? ... >>will not do with their continuing characters and overall storyline, ... >so Gerrold had a script, ... It worked for that one episode, ...
    (sci.space.history)
  • ATTN JMS: B5 (and general) script questions
    ... in reading the _B5_ script books that sometimes you just ... _what_ the characters are doing. ... Yet, in the aired episode, the scene ... give specific stage directions. ...
    (rec.arts.sf.tv.babylon5.moderated)
  • Re: FWIW: ST Enterprise Cancelled
    ... R told Ellison that " the network ... > will not do with their continuing characters and overall storyline, ... Well, jms had a better way of dealing with this, as when a neat script ... award in '63, none offered in '64, Strangelove took it in '65, none ...
    (sci.space.history)
  • Re: On topic - great software for an MT
    ... professional expander, and, believe me, you really, really, really want ... to simply typing a few characters and hitting a double space or F10. ... been completely blown away by the results, a single script that lets ...
    (sci.med.transcription)