Custom login form with signin button -- POSTing registration I have added a "register" button to the login form which is shown as a block on my homepage. I want the button to simply redirect to the registration page but it's POSTing to login and error'ing -- any ideas?

  function MYMODULE_form_user_login_alter(&amp;$form, &amp;$form_state) {
    $form['actions']['register'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; t('Sign Up'),
      '#submit' =&gt; array('_user_login_register_submit')
    );    
  }

  function _user_login_register_submit($form, &amp;$form_state) {
    drupal_goto('user/register');
  }
It's not working because the login form validate handler is executed, and fails, before the function you call with the #submit attribute.

You can use #validate like a workaround probably, but there's a cleaner way to achieve what you are after.

I wouldn't create a button element at all. Make it a link to user/register instead and style it to look like a button if needed.