I'm using eZ components for the first time and am trying to get to
grips with the UserInput component.  I have read the tutorials and the
api fairly thoroughly.

I have a checkbox on my form which returns a short string if checked.
I have defined in in the $definitions as

'administrator' => new ezcInputFormDefinitionElement(
                                 
ezcInputFormDefinitionElement::OPTIONAL,'string')

When I then check if the form is valid, when the checkbox is not
checked, even if all the other fields validate OK, then it returns
false.  With the checkbox fieldname (administrator) in the
invalidProperties array.

According to the api, the OPTIONAL parameter should mean that the
field does not have to be in the form (which it isn't as unchecked
checkboxes do not get passed to the program in the globals).  It looks
to me as if this is documented incorrectly, that the field does in
fact have to be present in $_POST/$_GET. Which means that the
component cannot be used with checkboxes.

Am I correct in thinking that this component is not behaving as
documented?  Have I defined the ezcInputFormDefinititionElement
incorrectly or is there somewhere else where I'm going wrong?

Any help would be much appreciated, this problem is a show-stopper for
me with this component.

regards
Hilary



-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to