Commit 5eba12c9 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Pass throught the element to validate to rule checking functions.

Now if the javascript function isn't available, the builder doesn't die -
it just skips the rule.
parent 576793c4
......@@ -623,7 +623,7 @@ class Form {
throw new FormException('No such form rule "' . $rule . '"');
}
}
if ($error = $function($values[$element['name']], $data)) {
if ($error = $function($values[$element['name']], $element, $data)) {
$this->set_error($element['name'], $error);
}
}
......@@ -646,7 +646,7 @@ class Form {
if (!function_exists($function)) {
@include_once('form/rules/' . $rule . '.php');
if (!function_exists($function)) {
throw new FormException('No such rule function "' . $function . '"');
continue;
}
}
$rdata = $function($element['name']);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment