validating groups with grouprules in QuickForm

From: Date: Fri, 06 May 2005 13:37:15 +0000
Subject: validating groups with grouprules in QuickForm
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19084@lists.php.net to get a copy of this message
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~ lukebarker@gmail.com http://www.battez.org --------------------------------------- I'm doggone gonna be with Some real people... ( R & E )

« previous php.pear.general (#19084) next »