1 form.inc theme_password($variables)

Returns HTML for a password form element.

Parameters

$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #size, #maxlength, #placeholder, #required, #attributes.

Related topics

File

core/includes/form.inc, line 4762
Functions for form and batch generation and processing.

Code

function theme_password($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'password';
  $element['#attributes']['spellcheck'] = !empty($element['#attributes']['spellcheck']) ? $element['#attributes']['spellcheck'] : 'false';

  element_set_attributes($element, array('id', 'name', 'size', 'maxlength', 'placeholder'));
  _form_set_class($element, array('form-text'));

  return '<input' . backdrop_attributes($element['#attributes']) . ' />';
}