For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > May 2005 > validating groups with grouprules in QuickForm









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author validating groups with grouprules in QuickForm
Luke Barker

2005-05-06, 3:57 pm

Hi,=20

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 =3D> 1) as having been submitted, which then allows me to
resolve that to 'Chess'.

All good -=20

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
=09=09=09
--=20

~L~

lukebarker@gmail.com
http://www.battez.org
---------------------------------------
I'm doggone gonna be with
Some real people...

( R & E )
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com