Drupal: $form_state['redirect'] getting URL Encoded

Was trying to redirect on a form submission to an achor tag on the same using

<?php
$form_state
['redirect'] = 'spinner#spinned';
?>

But it turns out that the result of the $form_state['redirect' actually causes redirection to "spinner%23spinned", with the passed url being URL-Encoded.

Passing an absolute URL to this solved it!

<?php
global $base_url;
$form_state['redirect'] = $base_url . 'spinner#spinned';
?>

Comments