Skip to main content
Tweeted twitter.com/#!/StackDrupal/status/346539833432358912

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'scall validation function in which iI check if all values are correct.

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

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

thanks for advice!

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's 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 doesnt use ajax.

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

thanks for advice!

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.

Source Link
gregab
  • 507
  • 2
  • 6
  • 20

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's 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 doesnt use ajax.

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

thanks for advice!