theme_password

Versions
4.7 – 6
theme_password($element)
7
theme_password($variables)

Theme 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, #required, #attributes.

Return value

A themed HTML string representing the form element.

Related topics

Code

includes/form.inc, line 2739

<?php
function theme_password($variables) {
  $element = $variables['element'];
  $size = $element['#size'] ? ' size="' . $element['#size'] . '" ' : '';
  $maxlength = $element['#maxlength'] ? ' maxlength="' . $element['#maxlength'] . '" ' : '';

  _form_set_class($element, array('form-text'));
  $output = '<input type="password" name="' . $element['#name'] . '" id="' . $element['#id'] . '" ' . $maxlength . $size . drupal_attributes($element['#attributes']) . ' />';
  return $output;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.