form_password

Versions
4.6
form_password($title, $name, $value, $size, $maxlength, $description = NULL, $attributes = NULL, $required = FALSE)

Format a single-line text field that does not display its contents visibly.

Parameters

$title The label for the text field.

$name The internal name used to refer to the field.

$value The initial value for the field at page load time.

$size A measure of the visible size of the field (passed directly to HTML).

$maxlength The maximum number of characters that may be entered in the field.

$description Explanatory text to display after the form item.

$attributes An associative array of HTML attributes to add to the form item.

$required Whether the user must enter some text in the field.

Return value

A themed HTML string representing the field.

Related topics

Code

includes/common.inc, line 1249

<?php
function form_password($title, $name, $value, $size, $maxlength, $description = NULL, $attributes = NULL, $required = FALSE) {
  $size = $size ? ' size="'. $size .'"' : '';
  return theme('form_element', $title, '<input type="password" class="'. _form_get_class('form-password', $required, _form_get_error($name)) .'" maxlength="'. $maxlength .'" name="edit['. $name .']" id="edit-'. $name .'"'. $size .' value="'. check_plain($value) .'"'. drupal_attributes($attributes) .' />', $description, 'edit-'. $name, $required, _form_get_error($name));
}
?>
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.