Bind event to checkbox

Re: Bind event to checkbox

by Davo Smith -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of 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).