form_set_error() field not highlited red When validating a field manually from my form a error is displayed but the field doesn't get red. For the first parameter i used the name of the input element. DRUPAL 7

if($form_state['values']['panes']['webform_nid31'][0]['contact_person'] == '') {
    form_set_error('panes[webform_nid31][0][contact_person]', t('You must select a name for this group of settings.'));
  }
If your form element is defined like that:
$form['panes']['webform_nid31'][0]['contact_person'] = array( ... );

your form_set_error call should look like that:
form_set_error('panes][webform_nid31][0][contact_person',
                t('You must select a name for this group of settings.'));

You need to set full path to element, without outside [ and ]. You could have many &quot;contact_person&quot; fields in one form, just in different branches of a form tree. Using only last index would made setting errors ambiguous, thus it's not supported. At least officially. Might work, but only as an undocumented feature.
Formatting this string is described in API:

Parameters
$name: The name of the form element. If the #parents property of your form element is array('foo', 'bar', 'baz') then you may set an error on 'foo' or 'foo][bar][baz'. Setting an error on 'foo' sets an error for every element where the #parents array starts with 'foo'.

Last but not least, actual output is defined in theme, it might well be something other than red border if theme author decided so.