\CustomConfirmedPasswordField
this allows you to add individual placeholders to the confirm password fields
- Author: patrick chitovoro
- Copyright: (c) 2015, Chito Systems
Synopsis
class CustomConfirmedPasswordField
extends FormField
{
- // members
- public $minLength = NULL;
- public $maxLength = NULL;
- public boolean $requireStrongPassword = false;
- public boolean $canBeEmpty = false;
- protected boolean $showOnClick = false;
- protected $confirmValue;
- public $showOnClickTitle;
- public FieldList $children;
- // methods
- public void __construct()
- public string Field()
- public ConfirmedPasswordField setCanBeEmpty()
- public ConfirmedPasswordField setShowOnClickTitle()
- public string getShowOnClickTitle()
- public ConfirmedPasswordField setRightTitle()
- public ConfirmedPasswordField setChildrenTitles()
- public ConfirmedPasswordField setValue()
- public void setName()
- public boolean isSaveable()
- public boolean validate()
- public boolean saveInto()
- public ReadonlyField performReadonlyTransformation()
- public $this setChildrenPlaceholders()
Hierarchy
Extends
- FormField
Members
protected
- $confirmValue
—
string
A place to temporarly store the confirm password value -
$showOnClick
If set to TRUE, the "password" and "confirm password" form fields will be hidden via CSS and JavaScript by default, and triggered by a link.
public
- $canBeEmpty
—
boolean
Allow empty fields in serverside validation - $children
—
FieldList
Child fields (_Password, _ConfirmPassword) - $maxLength
—
int
Maximum character length of the password. - $minLength
—
int
Minimum character length of the password. - $requireStrongPassword
—
boolean
Enforces at least one digit and one alphanumeric character (in addition to {$minLength} and {$maxLength} - $showOnClickTitle
—
string
Title for the link that triggers the visibility of password fields.
Methods
public
- __construct()
- Field()
- getShowOnClickTitle()
- isSaveable() — Determines if the field was actually shown on the client side - if not, we don't validate or save it.
- performReadonlyTransformation() — Makes a read only field with some stars in it to replace the password
- saveInto() — Only save if field was shown on the client, and is not empty.
- setCanBeEmpty() — Can be empty is a flag that turns on / off empty field checking.
- setChildrenPlaceholders()
- setChildrenTitles()
- setName() — Update the names of the child fields when updating name of field.
- setRightTitle()
- setShowOnClickTitle() — The title on the link which triggers display of the "password" and "confirm password" formfields. Only used if {@link setShowOnClick()} is set to TRUE.
- setValue() — Value is sometimes an array, and sometimes a single value, so we need to handle both cases.
- validate()