You are here

function no_autocomplete_form_alter in No Autocomplete 7

Same name and namespace in other branches
  1. 6 no_autocomplete.module \no_autocomplete_form_alter()

Implements hook_form_alter().

Turn off autocomplete on key forms.

File

./no_autocomplete.module, line 62
No_autocomplete.module.

Code

function no_autocomplete_form_alter(&$form, $form_state, $form_id) {

  // Add to the user_login and user_profile_form.
  if (substr($form_id, 0, 10) == 'user_login' && variable_get('no_autocomplete_login_form', FALSE)) {
    $form['pass']['#attributes']['autocomplete'] = 'off';
  }
}