Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.5, 2.0
-
Component/s: Forms Library
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
-
Fixed Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
Description
In addition to the existing 'eq' and 'checked' operators in the disabledIf functionality, a 'hide' operator is added which tells the forms library to hide the form element as well as disabling it.
Patch applies to CVSHEAD and MOODLE_19_STABLE.
Attachments
Issue Links
| This issue has a non-specific relationship to: | ||||
| MDL-18569 | Formslib disabledif does not work at all in Safari |
|
|
|
I'm still testing this with a client's Moodle. In particular, groups of radio buttons need testing.
TO TEST:
In your form definition, you will need an extra "hide" disabledIf line, in addition to the normal disabledIf condition(s). For example, an "other" text box that appears when the user picks "Other" from a select dropdown list:
$mform->disabledIf('othertext', 'occupationselect', 'neq', 'Other');
$mform->disabledIf('othertext', 'occupationselect', 'hide', '1');