This topic is locked

Can we limit or set a Max Lenght on a 'Text area' w/rich tex

10/4/2006 11:33:49 AM
PHPRunner General questions
F
fullfusion author

Is there a way to limit or set a Max Length when using a "Text area" (not Text Field)
under formatting, Edit As, with the Rich Text flag checked?
Or maybe via code (as a validation) somehow?
Thanks in advance!

Alexey admin 10/5/2006

Hi,
you can check the length of the textarea field in Before record updated event.
Just return false and display a message if the data is too long.

Here is the sample code:

global $message;

if(strlen($values["Text"])>1024)

{

$message "<div class=message><<< Field TEXT is too long >>></div>";

return false;

}
return true;


where Text is your actual field name. Please note that field names are case-sensitive here.