validating groups with grouprules in QuickForm

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

validating groups with grouprules in QuickForm

luke BAKING barker
Hi,

I have been having difficulty with validating the submitted values of
grouped elements in quickform.

For example, with a group of checkboxes,  I have an array('Chess',
'Darts', 'Croquet');

I make the checkboxes all fine and it submits (without any validation)
and say I had checked 'Chess' it yields

array(0 => 1) as having been submitted, which then allows me to
resolve that to 'Chess'.

All good -

but when I add a validation rule:

$myform->addGroupRule('mycheckboxgroup', 'Must be a selection', 'numeric');

it doesnt work, neither does nopunctuation. I think it is trying to
validate an array of values...

But how does one do this - surely I don't have to use a callback or
function rule?
I am sure I am missing some simple aspect - I have read the docs too
at pear.php.net

thanks

Luke
                       
--

~L~

[hidden email]
http://www.battez.org
---------------------------------------
I'm doggone gonna be with
Some real people...

(  R & E )

--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php