-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
2.2.2
-
None
-
MOODLE_22_STABLE
-
Easy
Improving usability of $mform addRule for "compare" (Common Rule Types):
old description
Improving usability of question editing I found that code below result in error:
$mform->addElement('text',$repeatname,$repeatstring,array('size'=>3));
$mform->addElement('hidden', $repeathiddenname, $repeats);
$mform->addRule($repeatname,null,'required',null,'client',true);
$mform->addRule($repeatname,null,'nonzero',null,'client',true);
//$mform->addRule(array($repeatname, $repeathiddenname),'You can\'t delete blanks','compare','>=','client',true);//uncommenting this line results in error in getValidationScriptIf you uncomment the last line you receive
"Fatal error: Call to a member function on a non-object in z:\home\moodle\www\lib\formslib.php" Line: 1799
The line with error is "$onBlur = $element->getAttribute('onBlur');" in function getValidationScript