I have a task to make some of the checkboxes in a form choice field disabled, and some not. Is there an easy way to achieve that without rewriting choice field layouts?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can set on your choice field the disabled state :
Or you could use an EventSubscriber to listen on PostSetData event if you have some logic needed to set the disabled state.
Check cookbook dynamic form generation for implementation details.