Re: [Phplib-users] OOHforms Textarea with minlength
Brought to you by:
nhruby,
richardarcher
From: Marko K. <M.K...@os...> - 2002-10-11 12:30:50
|
The solution is so easy: you need to copy the function self_validate($val) from of_text.inc into of_textarea.inc, as well as some var definitions in the textarea class. I appended my updated version of the latter originating from Joe's snapshot which is able to test minlength and maxlength at the same time as well as enables you to use regex validation, like $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 characters allowed!', 'value'=>'This is a test text area!')); Marko |