RE: [Phplib-users] OOH forms: error validating
Brought to you by:
nhruby,
richardarcher
|
From: Matt W. <ma...@ye...> - 2002-01-29 15:00:53
|
> "Tarique Sani wrote:
> > On Tue, 29 Jan 2002, Matt Williams wrote:
> >
> > You have to manually validate textareas of OOH form in your code
> > :-(
>
> That, or modify the of_textarea to have a similar functionality to
> that of of_text (without the 'multiple' option).
>
> I just did the above for multiple checkboxes (if valid_e exists, it
> checks that at least one checkbox is selected). Not too hard,
> especially in non-multiple mode, where the ndx array is rather simple.
>
Thanks.
So I just add a self_validate function to the bottom of of_textarea.inc and
this should check?
I tried this and couldn't get it to work. I even went as far as making the
function
function self_validate($val) {
if ($this->valid_e) {
return $this->valid_e;
}
return false;
}
just to return the error if valid_e was set without checking the value. My
add_element looks like this
$f->add_element(array("type"=>"textarea",
"name"=>"description",
"valid_e"=>"Please Enter a Description",
"rows"=>6,
"cols"=>25));
it just skips the check and validates the form
m:
|