Support › General › Add readonly attribute to checkbox list itemsResolved
How could I add a readonly attribute to checkbox list items if one them is checked.
'name' => __( 'Choices' ),
'id' => 'choices',
'type' => 'checkbox_list',
'options' => [
'none' => __( 'None', 'your-text-domain' ),
'1' => __( '1', 'your-text-domain' ),
'2' => __( '2', 'your-text-domain' ),
'3' => __( '3', 'your-text-domain' ),
If 'None' is checked, '1', '2', '3' have to be readonly.
I know it's weird, i can split this field with 2 radio button fields but I have to use 1 checkbox list.
Thank you 🙂
This field does not support a feature like that. But I think you can use the setting select_all_none to toggle all/none checkboxes. Please read more on the documentation https://docs.metabox.io/fields/checkbox-list/#settings