custom grouprule
| From: | Andrea Bakker | Date: | Tue, 23 Feb 2010 11:00:17 +0000 |
| Subject: | custom grouprule | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-30307@lists.php.net to get a copy of this message | ||
Hi
I have a group field for entry of a time hh:mm. I want to validate the time but am not sure how to
access the values it is passing to the function.
$eventform->addGroup($eventtime,'eventtime','Event Time
(hh:mm)',':');
// Add the rules to the group
$eventform->addGroupRule('eventtime',array($hour_rules, $minute_rules));
$eventform->registerRule('timevalid','function','valid_time');
$eventform->addGroupRule('eventtime','Invalid Time', 'timevalid');
function valid_time($element_name, $element_value)
{ echo "inside valid time";
$isValid = true;
echo "this is element name " . $element_name;
echo "this is element value " . $element_value;
}
It only appears to be passing the minutes, not the hour.
Any assistance would be appreciated.
Thanks
Andrea