Skip to main content

form validation messages are not rendered immediately

I have a form, with multiple (ajax) components. I have added a simple button in the middle of this form, to validate custom fields.

$form['fieldset_2']['forward'] = array(  
  '#type' => 'button',
  '#value' => t('Forward'),
  '#name' => 'btn_forward',
);

As expected, button call validation function in which I check if all values are correct.

  1. The validation messages are not rendered immediately. I have to refresh page to get the error messages. The button doesn't use ajax.

  2. I have a field type radios and form_set_error doesn't color the element with red or something.

gregab
  • 507
  • 2
  • 6
  • 20