Re: custom grouprule

From: Date: Wed, 24 Feb 2010 13:25:01 +0000
Subject: Re: custom grouprule
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-30309@lists.php.net to get a copy of this message
Your topic is in the wrong newsgroup. Post in general. On 2/23/2010 6:05 AM, Andrea Bakker wrote:
I've figured it out.... Sorry - you can ignore the previous message ----- Original Message ----- From: Andrea Bakker To: pear general Sent: Tuesday, February 23, 2010 11:00 AM Subject: custom grouprule 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


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