Page 1 of 1

fixed text area

Posted: Sun May 04, 2008 3:03 am
by DeFacto
Hello all,

Is there a possbility to make a multi line text area with fixed count of characters that can be inputed there?

Re: fixed text area

Posted: Sun May 04, 2008 3:32 am
by lafever
What do you mean by this? Allowing X amount of characters to be inputted in a textarea? It would be best to use JavaScript for this and then just make sure your PHP code also validates that it doesn't exceed that amount during your form validation process.

Re: fixed text area

Posted: Sun May 04, 2008 3:40 am
by DeFacto
i would like to avoid JAVA scripting.
lets say i have text area with parameters: width 200px height 300px. and there are 10 lines. i would like to make so that user could not add more text that can contain those 10 lines.
hope it is more clear.

Re: fixed text area

Posted: Sun May 04, 2008 3:50 am
by onion2k
There's nothing in HTML to limit a textarea like that. You need to check the input in PHP, and display an error to the user if they exceed it. Adding Javascript is probably a good idea too though - I doubt users would be too happy typing in more than 10 lines of text for it to be rejected.