10446 Posts in 2223 Topics by 1719 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 115 Views |
-
Unable to use NetefxValidatorRuleFUNCTION with MyLibrary

11 March 2013 at 6:35pm
Hello,
I have built a custom form.. When I tried to put validation I am not able to retain the posted values after the validation is fired. Various sites recommended the use of NetefxValidator module. However, I tried to create my own library for validation but NetefxValidatorRuleFUNCTION returns null. Please help.
Following is what i did in my code:
As per the documentation, I created a class file MyLibrary.php in mysite/code
$rule_startTime_Max = new NetefxValidatorRuleFUNCTION ("StartTime", "Start time cannot be greater than end time", 'error',array('MyLibrary', 'startTimeLessThanEndTime', array()))
class MyLibrary {
public static function startTimeLessThanEndTime($data, $args) {
return true;
}}
But the validation is fired every time. Also I tried print_r($data);exit(); but NetefxValidatorRuleFUNCTION .php
return call_user_func_array($function, $params);
always returns null...
| 115 Views | ||
|
Page:
1
|
Go to Top |

