Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#41 fix for of_textarea.php to allow checks of length&content

open
nobody
None
5
2003-01-15
2003-01-15
Anonymous
No

Hi,

the attached "of_textarea.php" is able to handle a min
and a max number of characters in the input, as well as
regex.

Using the following setup will allow 1 up to 3 small
characters:

$f->add_element(array('type'=>'textarea',
'name'=>'comment',
'rows'=>6,
'cols'=>40,
'wrap'=>20,
'minlength'=>1,
'maxlength'=>3,
'length_e'=>'at least 1 up
to 3 chars',
'valid_regex'=>'^[a-z]*$',
'valid_e'=>'only small
chars allowed!',
'value'=>'This is a test
text area!'));

Maybe this is useful if one wants to be sure there will
be input and on the other hand to limit its length from
the beginning on.

Marko

<mailto:mk2000@justmail.de>

Discussion

  • fixed "of_textarea.inc"

     
    Attachments