Prev: [ANNOUNCEMENT] PHP_CodeSniffer-1.3.0RC1 (beta) Released.
Next: [ANNOUNCEMENT] Mail_mimeDecode-1.5.3 (stable) Released.
From: zia mohades on 4 Sep 2010 11:45 Hi everyone, I am currently having a bit of issues when using the registerRule with the callback function. When I run $this->form->registerRule('checkadmindate1', 'callback', 'validate_checkAdminDate1'); I get the following error: *Fatal error*: Call to undefined function validate_checkAdminDate1() in * /usr/share/php/HTML/QuickForm/Rule/Callback.php* on line *81* * * My functinon validate_checkAdminDate1 , looks like this: function validate_checkAdminDate1($givenElement) { $date_taken_answered = $givenElement['Date_taken']; $date_taken_notanswered = $givenElement['Date_taken_not_answered']; if(($date_taken_answered['Y'] == "") && ($date_taken_answered['M'] == "") && ($date_taken_answered['d'] == "") && ($date_taken_notanswered == "")){ return false; } return true; } * * Any help is greatly appreciated with this! regards daniel
From: Christian Weiske on 9 Sep 2010 09:02
Hello Daniel, > I am currently having a bit of issues when using the registerRule > with the callback function. > > When I run > $this->form->registerRule('checkadmindate1', 'callback', > 'validate_checkAdminDate1'); > > I get the following error: > *Fatal error*: Call to undefined function validate_checkAdminDate1() Are you sure that the function is a) not a method (in a class) b) available (loaded) when the validation is called? Maybe you define the function after calling validate() -- Regards/Mit freundlichen GrüÃen Christian Weiske -=â¡ Geeking around in the name of science since 1982 â¡=- |