I have a form with multiple radios. I need to display the radios in a certain way(separately with additional form elements) so I had to use radio form elements instead of one radios element.
The radios are required but I have an issue with delegating the error to the parent element. I switched off the error message for the radios themselves via the #error_no_message
attribute. Now the form error is properly displayed for the parent element but the error message contains the label of the first radio element instead of the parent element. So for example if I have fieldset named "Manufacturer" and it contains radios with labels like "Audi", "Mercedes" or "BMW" and I won't select any radio the form error, after form submission, will say "Field Audi is required." instead of "Field Manufacturer is required".
So how can I delegate the form error to the parent(which is working) but with making the form error to be applied to the parent itself so the proper label is displayed?