diff --git a/docs/dev/reference/widgets/password.md b/docs/dev/reference/widgets/password.md index 3970975a8..58b54e48d 100644 --- a/docs/dev/reference/widgets/password.md +++ b/docs/dev/reference/widgets/password.md @@ -1,6 +1,34 @@ --- title: Password -description: Password text field (not yet documented) +description: Password text field. --- -{{< widget-notice >}} +This widget renders a `type="password"` text field, with the ability to show the otherwise obfuscated password (when +newly entered). + +![Password]({{% asset "images/dev/reference/widgets/password.png" %}}?classes=shadow) + +## Options + +This widget has no special options, but all options for the [`text`]({{% relref "text" %}}) widget are also +relevant. + +| Key | Value | +|-------------------|-----------------------------|--- +| `inputType` | `password` (string) | + +## Example + +```php +// … +'myPassword' => [ + 'inputType' => 'password', + 'eval' => [ + 'mandatory' => true, + 'minlength' => Config::get('minPasswordLength'), + 'tl_class' => 'w50' + ], + 'sql' => ['type' => 'string', 'length' => 255, 'default' => ''], +], +// … +``` diff --git a/page/assets/images/dev/reference/widgets/password.png b/page/assets/images/dev/reference/widgets/password.png new file mode 100644 index 000000000..777b8034c Binary files /dev/null and b/page/assets/images/dev/reference/widgets/password.png differ