Re: QuickForm Example ITDynamic_example.php does not work
| From: | Bertrand Mansion | Date: | Thu, 17 Apr 2003 21:08:49 +0000 |
| Subject: | Re: QuickForm Example ITDynamic_example.php does not work | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4936@lists.php.net to get a copy of this message | ||
<borz_off@cs.msu.su> wrote :
> Greetings!
>
> Carsten Bleek wrote:
>> Hi,
>>
>> When submitting the ITDynamic_example.php, the validation throws
>> an error becaus of a failed check for the required "iradYesNo"
>> yes/no radio button.
>>
>> Can someone confirm that this is a bug in the Quickform package?
>
> Yes, this is indeed a bug. I traced it back to _validateGroup(), but cannot
> fix it right away. :[
>
> If you do an addRule(..., 'required') on checkboxes or radios group it tries
> to check whether all checkboxes or radios are checked, which is
> counterintuitive, to say the least.
I agree, this is not right for radios but you could validate the radio group
using addGroupRule() with 'required' and 'howmany' set to 1. This is not a
bug, it's the expected behaviour: when you use addRule() instead of
addGroupRule() on a group, all elements in the group must be valid.
> Bertrand, how about setting changing the 'howmany' semantics from '$howmany
> value(s) are valid' to 'no invalid values exist and there is atleast $howmany
> valid value(s)' and setting 'howmany'=1 when doing addRule() on group element?
This is a good idea. We can discuss this a bit more off list, I need to make
some tests.
Bertrand Mansion
Mamasam