drupal 7 add element after the username input text element on login form I would like to add the domain name of my company in a simple  element right after the username login text input element. Something like this:



I already tried the instructions defined in https://drupal.org/node/350634 and this only affects the text field label or anything around the login form, but not the input fields themselves (unless I'm misunderstanding the directions). This method doesn't seem to affect how I can add an html element after the username text field but before the password text field.

I'm not certain how I should attempt this? Any direction would be wonderful.

BTW - I tried LoginToboggan to simply allow my users to use either their username or their email address, but that solution only partially works. We have LDAP integration, so for the first time the user attempts to log into our Drupal site they must use just their username (without the @companydomain.com) to allow the LDAP authentication to go through. I did not see a way to configure LoginToboggan to force the username through to the LDAP authentication.

Thanks
You need to add suffix element to username field in login form. You can do it using hook_form_alter(&amp;$form, &amp;$form_state, $form_id)

Implement above hook in your custom module

function YOURMODULENAME_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'user_login_block' || $form_id == 'user_login') {
    $form['name']['#suffix'] = '@mycompany.com';
  }
}