[support] User Login form alter

Jacob Roufa jacob.roufa at gmail.com
Sat Jan 15 23:45:07 UTC 2011


Hey all,

I've been working on this site in need of a form_alter on the user_login
form and using the below code the only item I've been successfully able to
alter is the submit button text. The account name doesn't change according
to what I specified, nor do the other form items unset. I've successfully
altered the user_register form with a separate case in the module shown
below. I have Login Destination and LoginToboggan installed and have tried
variations on 'user_login' to no avail and I still can't understand why one
alteration (the submit value) works while the rest do not.

Any ideas??


function custommodule_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {

    //user login
    case 'user_login':

//      $output .= print_r($form);

      unset($form['name']['#description']);
      unset($form['name']['#suffix']);
      unset($form['pass']['#description']);
      unset($form['pass']['#suffix']);

      $form['account']['name']['#title'] = t('E-mail address');
      $form['submit']['#value'] = t('Sign in');

      break;


Jake Roufa
208.557.9390
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110115/3ad91e6a/attachment-0001.html 


More information about the support mailing list