In a date_selector with the option 'optional' set to true to show the »Enabled« checkbox the checkbox should be activate by default. Moodle sets the checkbox to off and I don't find a way to change the default behavior.
I tried several variants of the »disabledIf« statement but without success - I guess because the »Enabled« checkbox is generated internally.
$mform->disabledIf('mycontrol', 'somecheckbox', 'checked');
Is there a possibility to activate »Enabled« by default?
Thanks a lot for any help.