#weight doesn't work on submit button I'm trying to add two links on custom user form.
The goal is this links to be displayed bellow the submit button. 
I've tried with weight property, but it's not working. 

What do I miss?

This is my code:

&lt;?php
      function custom_alter_form_alter (&amp;$form, &amp;$form_state, $form_id) {

        switch ($form_id) {
                case 'user_login':

                $form['name']['#title'] = t('Username');
                $form['pass']['#title'] = t('Password');
                $form['actions']['submit']['#value'] = t('Login');
                $form['actions']['submit']['#weight'] = 0;

                $form['page'] = array(
                '#markup' =&gt; '&lt;h2&gt;Login&lt;/h2&gt;',
                '#weight' =&gt; -10,
                );

                $form['register'] = array(

                '#type' =&gt; 'markup',    
                '#markup' =&gt; '&lt;div class="user-login-register"&gt;You don't have an account?
                &lt;a class="user-login-register" href="/user/register"&gt;  Click here&lt;/a&gt;&lt;/div&gt;',
                '#weight' =&gt; 1,
                );

                $form['password_reset'] = array(
                '#markup' =&gt; '&lt;a class="user-login-password-reset" href="/user/password"&gt; You forgot your password&lt;/a&gt;',
                '#weight' =&gt; 2,
                );

                //krumo($form); 
                break;
            }

        }
This line:

$form['actions']['submit']['#weight'] = 0;


only sets a submit's weight inside actions container.

To push actions to the top of the page, you need to affect it's own weigh:

$form['actions']['#weight'] = 0;


and if you want to move only one button, you can restructure your form by moving this button outside actions container:

$form['submit'] = $form['actions']['submit'];
$form['submit']['#weight'] = 0;
unset($form['actions']['submit']);


Note that this may break some forms that expect submit button in it's exact original place in form structure.