fixed text area

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DeFacto
Forum Commoner
Posts: 37
Joined: Wed Apr 23, 2008 2:30 pm

fixed text area

Post 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?
User avatar
lafever
Forum Commoner
Posts: 99
Joined: Sat Apr 05, 2008 2:03 pm
Location: Taylor, MI

Re: fixed text area

Post 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.
DeFacto
Forum Commoner
Posts: 37
Joined: Wed Apr 23, 2008 2:30 pm

Re: fixed text area

Post 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.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: fixed text area

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