I am trying to redirect users to the anchor of the error form field after form validation.
In the form I set the form validation handler with the following code.
$form['#validate'] = 'my_form_validate';
In the validation handler, if the form shows some error message, I am trying to scroll to error field.
function my_form_validate() { ... $form_state['redirect'] = 'node/' . $form['nid']['#value'] . '#' . $error_field_anchor; ... }
The form is not redirecting after validation.
I have tried other paths, such as user/1, node/123 without anchor but the form is not getting redirected to that one.