Add a title / group name to some checkboxs

Add a title / group name to some checkboxs

by Raphael Goldman -
Number of replies: 1

I have 2 checkboxs:

        $mform->addElement('advcheckbox', 'test1', 'Test 1', null, array('group' => 1));
        $mform->addElement('advcheckbox', 'test2', 'Test 2', null, array('group' => 1));
        $this->add_checkbox_controller(1);

I want those 2 checkboxs to be part of a group, how can I add a title before those 2 options?

Average of ratings: -
In reply to Raphael Goldman

checkbox group - checked option

by Raphael Goldman -

I have a checkbox group, In the edit form I want to checked the option that I query from the database,

Is thee any way to supply an array of nembers and all the checkbox will checked, or I need to do it one by one using a foreach loop?

Thanks