How to get attributes of the form elements?
You can do it like this:

function my_form_validate(OR_SUBMIT)($form, &amp;$form_state)
{
  $msg = '';
  foreach(element_children($form[FIELDSET_NAME]) as $key =&gt; $value) {
    $msg .= $form[FIELDSET_NAME][$value]['#title'] . ' ';
  }
}