Re: Limiting character input in <textarea>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Garth,

Tuesday, November 16, 2004, 7:59:35 AM, you wrote:

GHS> Unlike the input fields that use maxlength to define the number of character
GHS> allowed. Textarea doesnt seem to have that capability. I want to limit the
GHS> number of character to 255.

GHS> IS there any way of doing this without having to break my neck about it?

Client-side, only with JavaScript.

Server-side, just count how many characters they have entered:

if (strlen($textarea_content) > 255)
{
   echo "Error message here";
}

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux