How to get attributes of the form elements? I know that it should be easy, but currently it doesnt work.
In my function I want to get #title of each element in the form. My form is fieldset "add_company". For example, when I try to get #title:

$msg = '';
foreach ($form['values']['add_company'] as $item)
    $msg .= $item['#title'] . ' ';


But I receive nothing.

Second part of question is when i try smth like this:

$value = $form_state['values']['add_company']['offers']['#title'];


I receive "O", but not "Offers".
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'] . ' ';
  }
}