FormPassword
class FormPassword extends FormTextbox
Class FormPassword
Traits
Trait FormTextboxTrait
Constants
| INPUT_FILTER_NUMERIC |
Possible input filters for setInputFilter() |
| INPUT_FILTER_MONEY |
|
| INPUT_FILTER_DECIMAL |
|
| INPUT_FILTER_INTEGER |
|
| INPUT_FILTER_OPERATOR |
|
| INPUT_FILTER_STRING |
|
Properties
| protected array | $config | from FormBase | |
| bool | $save_requires_edit_var | from FormBase | |
| Form | $form | from FormComponent | |
| protected | $field_disable_save | Set to false if this field is not "saveable", e.g. static test |
from FormBase |
| $REQUEST_VARS | from FormComponent | ||
| $name | from FormComponent | ||
| callable|bool | $db_handler | from FormComponent |
Methods
Adds a password repeat field to the same form as this one with the same config and sets this field for the repeat password check.
Adds a static text field to the form which contains a random password for the user and the password complexity indicator which changes when the user types in the password field.
Display field
Display field in print mode
No description
Return Dom Selector for this field within the current form (This is NOT necessary unique if you are having 2 forms with identical names in form and field names
Get Element Visibility Class Formerly known as tag class
Does this component use combined input fields which required special handling from form?
Return if the component should be shown as required with specified style class.
Init will be called AFTER __construct() and init_obj() with $this->form set
Checks if the field is hidden by a tag. It is important when validating
No description
Save
Set Auto Title attribute, usually visible when no data has been entered into the field This attribute is very similar to the placeholder attribute an may conflict if both are set.
Set value for autocomplete attribute, e.g. email, username, new-password, current-password, one-time-code
No description
Show Custom Error Message for this field
Format output to show as formatted numeric value.
Automatically format the default value using an call to the XELOS Format Helper
Set input filter - a javascript input check. This may conflict with a HTML5 pattern attribute.
Field is to be loaded from and saved to database.
Hash password on save using \XELOS\Framework\XF\User::hash_password
Field is considered to be translatable. This is usually determined automatically reading the instance configuration of the calling instance
Consider Field as required
Set max chars for this field Array Syntax: maxlength
If this field is used to check a password which is repeated, you can use this method.
Set HTML5 Placeholder Attribute, usually visible when no data has been entered into the field
Manipulate another fields data when the value of the current field changes.
Add Custom HTML before the field element
Show Copy to Clipboard function next to this field?
Submit the form when the user presses enter? (Standard for POST forms, but not standard for GET forms) Useful if you are implementing a search form using GET request method
Set Title attribute, title is shown on hovering over the field
Set HTML5 REGEX Pattern Attribute, which will be used by browsers to validate user input
Set Visibility Dependency if you want your field only to be shown if another field has a specify value Array Syntax: tag, tag_source
Set field to be the event source for another dependent field. Changes of this fields values will trigger events to their dependent fields and change their visibility in the frontend
Should this field be marked with HTML5 required attribute? HTML5 required should not be used when field may be hidden, as it might still be required frontend-wise, even if hidden!
Should this field be treated as required during request validation?
Details
in
FormBase at line 31
__construct()
FormBase constructor.
The constructor is able to set an array of properties options
at line 66
FormPassword
addRepeatPasswordField(string|null $name = null)
Adds a password repeat field to the same form as this one with the same config and sets this field for the repeat password check.
at line 85
FormStaticText
addStrengthIndicator(string|null $name = null, int $passwordMinLength = 0, int $minPasswordScore = 0)
Adds a static text field to the form which contains a random password for the user and the password complexity indicator which changes when the user types in the password field.
in
FormBase at line 198
append(string $name, mixed $value, bool|string $key = false)
No description
in
FormBase at line 183
void
concat(string $name, string $value)
No description
in
FormBase at line 168
mixed
destroy($name)
No description
at line 15
string
display_field(string $fieldname, $value = '', string $type = 'textbox')
Display field
in
FormTextbox at line 301
string
display_field_print(string $fieldname, string $default_value = false)
Display field in print mode
in
FormTextboxTrait at line 21
string
display_textbox_field(string $fieldname, bool $default_value = false, string $type = 'textbox')
No description
in
FormBase at line 77
mixed
get(string $name)
No description
in
FormBase at line 84
array
getConfig()
No description
in
FormComponent at line 588
string
getDomSelector()
Return Dom Selector for this field within the current form (This is NOT necessary unique if you are having 2 forms with identical names in form and field names
in
FormComponent at line 600
protected string
getElementVisibilityClass()
Get Element Visibility Class Formerly known as tag class
in
FormComponent at line 501
bool
getIsVisible()
Determine visibilty based on user input on dependent fields
in
FormComponent at line 317
string
getLabel()
Get Field label
in
FormComponent at line 156
string
get_description()
No description
in
FormComponent at line 257
mixed
get_display_value()
returns the displayed value
in
FormBase at line 217
array
get_group(string $prefix)
No description
in
FormBase at line 92
array
get_properties()
No description
in
FormComponent at line 56
array|bool
get_validation_options()
No description
in
FormComponent at line 175
get_value()
No description
in
FormComponent at line 48
bool
hasCombinedInputFields()
Does this component use combined input fields which required special handling from form?
in
FormComponent at line 651
protected bool
hasRequiredStyle()
Return if the component should be shown as required with specified style class.
in
FormComponent at line 32
void
init()
Init will be called AFTER __construct() and init_obj() with $this->form set
in
FormBase at line 39
init_obj()
Initializes the form base
in
FormComponent at line 549
$this
insertAfter(FormComponent $formComponent = null)
Insert this field after the specified field
in
FormComponent at line 534
$this
insertBefore(FormComponent $formComponent = null)
Insert this field before the specified field
in
FormComponent at line 374
bool
isReadonly()
Returns TRUE if field is readonly, FALSE otherwise.
in
FormBase at line 237
bool
is_displayed()
Checks if the field is hidden by a tag. It is important when validating
in
FormComponent at line 240
void
post_process()
No description
in
FormComponent at line 169
void
process()
Process e.g. file upload, resize etc.
in
FormComponent at line 187
string
render(string|false $name = false, string|false $value = false)
No description
at line 23
mixed
save()
Save
in
FormBase at line 104
$this
set(string $propertyName, mixed $propertyValue)
No description
in
FormTextbox at line 367
$this
setAutoTitle(string $title = '')
Set Auto Title attribute, usually visible when no data has been entered into the field This attribute is very similar to the placeholder attribute an may conflict if both are set.
It is advised to use the placeholder attribute as HTML5 standard
in
FormTextbox at line 498
FormTextbox
setAutocomplete(string $type)
Set value for autocomplete attribute, e.g. email, username, new-password, current-password, one-time-code
Full list: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
in
FormComponent at line 396
$this
setCSSClassName(string $class = null)
Set Field Row CSS class name
in
FormTextbox at line 389
$this
setCSSStyle(string $style = '')
Set Custom CSS Style
at line 138
FormPassword
setCheckPasswordStrength(bool $bool = true)
No description
in
FormComponent at line 564
$this
setCustomErrorText(string $error_msg)
Show Custom Error Message for this field
in
FormComponent at line 385
FormComponent
setDefaultValue(mixed $value = null)
Set Field default value
in
FormComponent at line 418
$this
setDescriptionText(string $description = null)
Set Field Help Text
in
FormTextbox at line 437
$this
setDisplayFilterNumeric(bool $displayAsMoney = false)
Format output to show as formatted numeric value.
This will be in the users locale, e.g. german users will see a COMMA (,) where english users will see a POINT (.)
in
FormTextbox at line 451
$this
setFormat(string $format = '')
deprecated
deprecated
Automatically format the default value using an call to the XELOS Format Helper
in
FormComponent at line 578
$this
setGridClass(string $gridClass = null)
Set Flexbox Grid Class
in
FormComponent at line 407
$this
setHelpText(string $help = null)
Set Field Help Text
in
FormTextbox at line 424
$this
setInputFilter(string $inputFilter = self::INPUT_FILTER_NUMERIC)
Set input filter - a javascript input check. This may conflict with a HTML5 pattern attribute.
This will be in the users locale, e.g. german users will see a COMMA (,) where english users will see a POINT (.)
in
FormComponent at line 341
$this
setIsDBField(bool $bool = true)
Field is to be loaded from and saved to database.
at line 53
FormPassword
setIsHashedOnSave(bool $hashOnSave = true, int $userId = 0)
Hash password on save using \XELOS\Framework\XF\User::hash_password
in
FormComponent at line 354
$this
setIsI18NField(bool $bool = true)
Field is considered to be translatable. This is usually determined automatically reading the instance configuration of the calling instance
in
FormComponent at line 365
$this
setIsReadonly(bool $bool = true)
Consider Field as readonly
in
FormComponent at line 330
$this
setIsRequired(bool $bool = true, bool $onlyRequiredIfVisible = true)
Consider Field as required
in
FormComponent at line 293
$this
setLabel(string $label = '', string $icon_class = null)
Set Field label
in
FormComponent at line 308
$this
setLabelIconClass(string $icon_class = '')
Set label icon class
in
FormTextbox at line 332
$this
setMaxlength(int $length = null)
Set max chars for this field Array Syntax: maxlength
in
FormTextbox at line 473
$this
setOnChangeJS(string $jsfunction = '')
Set the onchange HTML attribute
in
FormTextbox at line 462
$this
setOnClickJS(string $jsfunction = '')
Set the onclick HTML attribute
at line 124
FormPassword
setPasswordField(FormPassword $passwordField)
If this field is used to check a password which is repeated, you can use this method.
It will check if the value of this field matches the value of the given $passwordField.
in
FormTextbox at line 378
$this
setPlaceholder(string $title = '')
Set HTML5 Placeholder Attribute, usually visible when no data has been entered into the field
in
FormComponent at line 453
$this
setPopulateField(FormComponent $target, string $dataURL = null)
Manipulate another fields data when the value of the current field changes.
Common usage: Populate a second select once user chooses from the first select
in
FormComponent at line 429
$this
setPrefixHTML(string $html = null)
Add Custom HTML before the field element
in
FormTextbox at line 343
$this
setShowCopyToClipboard(bool $bool = true)
Show Copy to Clipboard function next to this field?
in
FormTextbox at line 485
$this
setSubmitOnEnter(bool $bool = true)
Submit the form when the user presses enter? (Standard for POST forms, but not standard for GET forms) Useful if you are implementing a search form using GET request method
in
FormComponent at line 440
$this
setSuffixHTML(string $html = null)
Add Custom HTML after the field element
in
FormTextbox at line 354
$this
setTitle(string $title = '')
Set Title attribute, title is shown on hovering over the field
in
FormTextbox at line 401
$this
setValidationPattern(string $pattern = '', string $onInvalidMessage = null)
Set HTML5 REGEX Pattern Attribute, which will be used by browsers to validate user input
in
FormComponent at line 467
$this
setVisibilityDependsOn(FormComponent $formComponent = null, array $matchingValues = [])
Set Visibility Dependency if you want your field only to be shown if another field has a specify value Array Syntax: tag, tag_source
in
FormComponent at line 491
$this
setVisibilityIsSource(bool $bool = true)
Set field to be the event source for another dependent field. Changes of this fields values will trigger events to their dependent fields and change their visibility in the frontend
Fields are automatically set to be a source if used in a call of setVisibilityDependsOn()
Array Syntax: tag_source
in
FormComponent at line 248
set_display_value(mixed $value)
set the displayed value
in
FormBase at line 153
void
set_properties(array $array)
No description
in
FormComponent at line 40
set_request_vars($request)
No description
in
FormTextbox at line 40
array
validate()
No description
in
FormComponent at line 639
protected bool
validateInFrontendAsRequired()
Should this field be marked with HTML5 required attribute? HTML5 required should not be used when field may be hidden, as it might still be required frontend-wise, even if hidden!
in
FormComponent at line 624
protected bool
validateInRequestAsRequired()
Should this field be treated as required during request validation?