Using hook_form_alter on an existing form element I'm using the Commerce module and in the checkout process I'd like to change the size of one of the input fields. I'm trying to use the following code but it doesn't seem to be working. 

Am I doing this correctly? Or is there a better way to change the size of an existing form input field?

function mytheme_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    if ($form_id == 'form-AyTG_90yQduNFHHSAwpVnMfNNXEt5iv_eUvptp_Ex7E') {
        $form['edit-account-login-mail'] = array(
            '#size' =&gt; 40,
        );
    }
}
Not sure which checkout form you try to alter, however, I've used mytheme_form_commerce_checkout_form_checkout_alter(&amp;$form, &amp;$form_state, $form_id) and mytheme_form_commerce_checkout_form_review_alter(&amp;$form, &amp;$form_state, $form_id) successfully.

And if I understand it correctly, the element 'edit-account-login-mail' already exists in your form. Therefore, I think you might want to add the size property instead of overwriting the form element, for instance:

$form['edit-account-login-mail']['#size'] = 40;