I have written some custom validation for each element in a form. I use the following method to display errors. It automatically highlights the required fields.
form_set_error('field_athletes_male', 'Athletes Male field is required.');
My problem is that there are nested element names like this:
field_coaching_programme[und][0][field_organisation_delivered_by][und][0][value]
The validation message is shown successfully but the element is not highlighted.