General developer forum

Bind event to checkbox

Re: Bind event to checkbox
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Use the standard Moodle disabledIf functionality.

I don't have code in front of me, but it should look something like:

$mform->disabledIf('coursePrice', 'is_premium', 'notchecked');

(I suggest you search for examples in the code and copy what they do).

Average of ratings: -