htmlInputField
extends htmlElement
in package
A standard input field.
Table of Contents
- ALIGN_BOTTOM = 3
- align to bottom
- ALIGN_CENTER = 4
- align to center
- ALIGN_LEFT = 1
- align to left
- ALIGN_RIGHT = 2
- align to right
- ALIGN_TOP = 0
- align to top
- $alignment : mixed
- alignment when inside a table
- $colspan : mixed
- colspan if inside a table
- $rowspan : mixed
- rowspan if inside a table
- $autocomplete : mixed
- enable autocomplete
- $autocompleteValues : mixed
- autocompletion suggestions
- $autoTrim : mixed
- marks the input field as auto trimmed (remove spaces at start/end)
- $calendarFormat : mixed
- calendar format
- $calendarFormatWithSeconds : mixed
- calendar with seconds
- $calendarFormatWithTime : mixed
- calendar with time
- $checkPasswordStrength : mixed
- check password strength
- $cssClasses : mixed
- CSS classes
- $disableAutoFill : mixed
- disables browser autofilling of password fields
- $fieldMaxLength : mixed
- field max length (default 1000)
- $fieldName : mixed
- unique field name
- $fieldSize : mixed
- field size (default 30)
- $fieldValue : mixed
- field value
- $id : mixed
- id
- $isEnabled : mixed
- enabled or disabled
- $isPassword : mixed
- password field
- $maxValue : mixed
- maximum value
- $minValue : mixed
- minimum value
- $obfuscate : mixed
- indicates that the value should be saved in obfuscated form
- $onInput : mixed
- oninput event
- $onKeyPress : mixed
- on keypress event
- $onKeyUp : mixed
- on keyupp event
- $required : mixed
- required field
- $sameValueFieldID : mixed
- field ID that needs to have same value (e.g. password field)
- $showCalendar : mixed
- show calendar
- $showDnSelection : mixed
- show DN selection
- $stepValue : mixed
- step for numeric values
- $tableCellCssClasses : mixed
- table cell CSS classes
- $title : mixed
- title attribute
- $transient : mixed
- indicates that this field should not automatically be saved in the self service or server profile
- $type : mixed
- input type
- $validationPattern : mixed
- validation pattern
- $accessibilityLabel : string|null
- accessibility label
- $dataAttributes : mixed
- data attributes
- __construct() : mixed
- Constructor
- addDataAttribute() : mixed
- Adds a data attribute.
- disableAutoTrim() : mixed
- enableAutocompletion() : mixed
- Enables autocompletion for this input field.
- filterSelectBox() : mixed
- Turns this field into a live filter for a select box.
- generateHTML() : array<string|int, mixed>
- Prints the HTML code for this element.
- getAccessibilityMarkup() : string
- Returns the markup for the accessibility data.
- getAlignmentString() : string
- Returns the HTML attributes for the alignment.
- getColspanString() : string
- Returns the HTML attribute for the colspan.
- getCSSClasses() : array<string|int, mixed>
- Returns the CSS classes of this element.
- getRowspanString() : string
- Returns the HTML attribute for the rowspan.
- getTableCellCSSClasses() : array<string|int, mixed>
- Returns the CSS classes of the surrounding table cell for this element.
- setAccessibilityLabel() : void
- Sets the accessibility label.
- setCSSClasses() : mixed
- Adds CSS classes to this element.
- setFieldMaxLength() : mixed
- Sets the maximum field length.
- setFieldSize() : mixed
- Sets the field size (default is 30).
- setId() : mixed
- Sets the element ID.
- setIsEnabled() : mixed
- Specifies if this component is enabled and accepts user modification.
- setIsPassword() : mixed
- Specifies if this is a password field.
- setMinimumAndMaximumNumber() : mixed
- Sets the field as number field with minimum and maximum values.
- setObfuscate() : mixed
- Specifies if the value should be saved in obfuscated form (e.g. self service profile).
- setOnInput() : void
- Sets the JavaScript for the onInput event.
- setOnKeyPress() : mixed
- Sets the JavaScript for the onKeyPress event.
- setOnKeyUp() : mixed
- Sets the JavaScript for the onKeyUp event.
- setRequired() : mixed
- Specifies if the input field is required.
- setSameValueFieldID() : mixed
- Specifies the ID of a second field that must have the same value as this field.
- setStepValue() : void
- Sets the step value for number fields.
- setTableCellCSSClasses() : mixed
- Adds CSS classes to the surrounding table cell for this element.
- setTitle() : mixed
- Sets the title for the input field.
- setTransient() : mixed
- Specifies that the value should not be automatically saved when used in self service or server profile (default: false).
- setType() : void
- Sets the input type.
- setValidationPattern() : void
- Sets the validation pattern.
- showCalendar() : mixed
- Shows a calendar when the field is selected.
- showDnSelection() : mixed
- Shows a DN selection next to input field.
- getDataAttributesAsString() : string
- Returns the data attributes as rendered string.
- isAutoTrim() : bool
- Returns if the field content should be auto-trimmed (remove spaces at start/end).
Constants
ALIGN_BOTTOM
align to bottom
public
mixed
ALIGN_BOTTOM
= 3
ALIGN_CENTER
align to center
public
mixed
ALIGN_CENTER
= 4
ALIGN_LEFT
align to left
public
mixed
ALIGN_LEFT
= 1
ALIGN_RIGHT
align to right
public
mixed
ALIGN_RIGHT
= 2
ALIGN_TOP
align to top
public
mixed
ALIGN_TOP
= 0
Properties
$alignment
alignment when inside a table
public
mixed
$alignment
$colspan
colspan if inside a table
public
mixed
$colspan
$rowspan
rowspan if inside a table
public
mixed
$rowspan
$autocomplete
enable autocomplete
protected
mixed
$autocomplete
= \false
$autocompleteValues
autocompletion suggestions
protected
mixed
$autocompleteValues
= []
$autoTrim
marks the input field as auto trimmed (remove spaces at start/end)
protected
mixed
$autoTrim
= \true
$calendarFormat
calendar format
protected
mixed
$calendarFormat
= ''
$calendarFormatWithSeconds
calendar with seconds
protected
mixed
$calendarFormatWithSeconds
= \false
$calendarFormatWithTime
calendar with time
protected
mixed
$calendarFormatWithTime
= \false
$checkPasswordStrength
check password strength
protected
mixed
$checkPasswordStrength
= \false
$cssClasses
CSS classes
protected
mixed
$cssClasses
= []
$disableAutoFill
disables browser autofilling of password fields
protected
mixed
$disableAutoFill
= \false
$fieldMaxLength
field max length (default 1000)
protected
mixed
$fieldMaxLength
= 1000
$fieldName
unique field name
protected
mixed
$fieldName
$fieldSize
field size (default 30)
protected
mixed
$fieldSize
= 30
$fieldValue
field value
protected
mixed
$fieldValue
= ''
$id
id
protected
mixed
$id
$isEnabled
enabled or disabled
protected
mixed
$isEnabled
= \true
$isPassword
password field
protected
mixed
$isPassword
= \false
$maxValue
maximum value
protected
mixed
$maxValue
$minValue
minimum value
protected
mixed
$minValue
$obfuscate
indicates that the value should be saved in obfuscated form
protected
mixed
$obfuscate
= \false
$onInput
oninput event
protected
mixed
$onInput
$onKeyPress
on keypress event
protected
mixed
$onKeyPress
$onKeyUp
on keyupp event
protected
mixed
$onKeyUp
$required
required field
protected
mixed
$required
= \false
$sameValueFieldID
field ID that needs to have same value (e.g. password field)
protected
mixed
$sameValueFieldID
$showCalendar
show calendar
protected
mixed
$showCalendar
= \false
$showDnSelection
show DN selection
protected
mixed
$showDnSelection
= \false
$stepValue
step for numeric values
protected
mixed
$stepValue
$tableCellCssClasses
table cell CSS classes
protected
mixed
$tableCellCssClasses
= []
$title
title attribute
protected
mixed
$title
$transient
indicates that this field should not automatically be saved in the self service or server profile
protected
mixed
$transient
= \false
$type
input type
protected
mixed
$type
= 'text'
$validationPattern
validation pattern
protected
mixed
$validationPattern
$accessibilityLabel
accessibility label
private
string|null
$accessibilityLabel
= \null
$dataAttributes
data attributes
private
mixed
$dataAttributes
= []
Methods
__construct()
Constructor
public
__construct(string $fieldName[, string $fieldValue = null ][, string $fieldSize = null ]) : mixed
Parameters
- $fieldName : string
-
unique field name
- $fieldValue : string = null
-
value of input field (optional)
- $fieldSize : string = null
-
input field length (default 30)
Return values
mixed —addDataAttribute()
Adds a data attribute.
public
addDataAttribute(string $key, string $value) : mixed
Parameters
- $key : string
-
attribute name (without "data-")
- $value : string
-
attribute value
Return values
mixed —disableAutoTrim()
public
disableAutoTrim() : mixed
Return values
mixed —enableAutocompletion()
Enables autocompletion for this input field.
public
enableAutocompletion(array<string|int, mixed> $values) : mixed
Parameters
- $values : array<string|int, mixed>
-
list of values to suggest
Return values
mixed —filterSelectBox()
Turns this field into a live filter for a select box.
public
filterSelectBox(string $name) : mixed
Cannot be used together with setOnKeyUp().
Parameters
- $name : string
-
select box name
Return values
mixed —generateHTML()
Prints the HTML code for this element.
public
generateHTML(string $module, array<string|int, mixed> $input, array<string|int, mixed> $values, bool $restricted, string $scope) : array<string|int, mixed>
Parameters
- $module : string
-
Name of account module
- $input : array<string|int, mixed>
-
List of meta-HTML elements
- $values : array<string|int, mixed>
-
List of values which override the defaults in $input (name => value)
- $restricted : bool
-
If true then no buttons will be displayed
- $scope : string
-
Account type
Return values
array<string|int, mixed> —List of input field names and their type (name => type)
getAccessibilityMarkup()
Returns the markup for the accessibility data.
public
getAccessibilityMarkup() : string
Return values
string —markup to be included in HTML tag (starting with space)
getAlignmentString()
Returns the HTML attributes for the alignment.
public
getAlignmentString() : string
Return values
string —alignment HTML attributes (e.g. align="right" valign="top")
getColspanString()
Returns the HTML attribute for the colspan.
public
getColspanString() : string
Return values
string —colspan HTML attribute (e.g. colspan=3)
getCSSClasses()
Returns the CSS classes of this element.
public
getCSSClasses() : array<string|int, mixed>
Return values
array<string|int, mixed> —$classes CSS class names
getRowspanString()
Returns the HTML attribute for the rowspan.
public
getRowspanString() : string
Return values
string —rowspan HTML attribute (e.g. rowspan=3)
getTableCellCSSClasses()
Returns the CSS classes of the surrounding table cell for this element.
public
getTableCellCSSClasses() : array<string|int, mixed>
Return values
array<string|int, mixed> —CSS classes
setAccessibilityLabel()
Sets the accessibility label.
public
setAccessibilityLabel(string|null $accessibilityLabel) : void
Parameters
- $accessibilityLabel : string|null
-
label
Return values
void —setCSSClasses()
Adds CSS classes to this element.
public
setCSSClasses(array<string|int, mixed> $classes) : mixed
Parameters
- $classes : array<string|int, mixed>
-
CSS class names
Return values
mixed —setFieldMaxLength()
Sets the maximum field length.
public
setFieldMaxLength(int $fieldMaxLength) : mixed
Parameters
- $fieldMaxLength : int
-
length
Return values
mixed —setFieldSize()
Sets the field size (default is 30).
public
setFieldSize(int $fieldSize) : mixed
Parameters
- $fieldSize : int
-
size
Return values
mixed —setId()
Sets the element ID.
public
setId(string $id) : mixed
Parameters
- $id : string
-
id
Return values
mixed —setIsEnabled()
Specifies if this component is enabled and accepts user modification.
public
setIsEnabled(bool $isEnabled) : mixed
Parameters
- $isEnabled : bool
-
enabled if true
Return values
mixed —setIsPassword()
Specifies if this is a password field.
public
setIsPassword(bool $isPassword[, bool $checkStrength = false ][, bool $disableAutoFill = false ]) : mixed
Parameters
- $isPassword : bool
-
password field
- $checkStrength : bool = false
-
check if matches password policy (default: false)
- $disableAutoFill : bool = false
-
prevent autofilling by browser
Return values
mixed —setMinimumAndMaximumNumber()
Sets the field as number field with minimum and maximum values.
public
setMinimumAndMaximumNumber(int $minimum[, int $maximum = null ][, int $step = 1 ]) : mixed
Parameters
- $minimum : int
-
minimum
- $maximum : int = null
-
maximum
- $step : int = 1
-
step value
Return values
mixed —setObfuscate()
Specifies if the value should be saved in obfuscated form (e.g. self service profile).
public
setObfuscate(bool $obfuscate) : mixed
Parameters
- $obfuscate : bool
-
obfuscate value
Return values
mixed —setOnInput()
Sets the JavaScript for the onInput event.
public
setOnInput(string $onInput) : void
Parameters
- $onInput : string
-
JavaScript code
Return values
void —setOnKeyPress()
Sets the JavaScript for the onKeyPress event.
public
setOnKeyPress(string $onKeyPress) : mixed
Parameters
- $onKeyPress : string
-
JavaScript code
Return values
mixed —setOnKeyUp()
Sets the JavaScript for the onKeyUp event.
public
setOnKeyUp(string $onKeyUp) : mixed
Parameters
- $onKeyUp : string
-
JavaScript code
Return values
mixed —setRequired()
Specifies if the input field is required.
public
setRequired(bool $required) : mixed
Parameters
- $required : bool
-
required
Return values
mixed —setSameValueFieldID()
Specifies the ID of a second field that must have the same value as this field.
public
setSameValueFieldID(string $sameValueFieldID) : mixed
This field is marked red if different or green if equal.
Parameters
- $sameValueFieldID : string
-
ID of reference field
Return values
mixed —setStepValue()
Sets the step value for number fields.
public
setStepValue(int $step) : void
Parameters
- $step : int
-
step value (e.g. 1)
Return values
void —setTableCellCSSClasses()
Adds CSS classes to the surrounding table cell for this element.
public
setTableCellCSSClasses(array<string|int, mixed> $classes) : mixed
Parameters
- $classes : array<string|int, mixed>
-
CSS class names
Return values
mixed —setTitle()
Sets the title for the input field.
public
setTitle(string $title) : mixed
Parameters
- $title : string
-
title value
Return values
mixed —setTransient()
Specifies that the value should not be automatically saved when used in self service or server profile (default: false).
public
setTransient(bool $transient) : mixed
Parameters
- $transient : bool
-
transient field
Return values
mixed —setType()
Sets the input type.
public
setType(string $type) : void
Parameters
- $type : string
-
type (e.g. number)
Return values
void —setValidationPattern()
Sets the validation pattern.
public
setValidationPattern(string $pattern) : void
Parameters
- $pattern : string
-
pattern (e.g. "[0-9]{3}")
Return values
void —showCalendar()
Shows a calendar when the field is selected.
public
showCalendar(string $format[, bool $withTime = false ][, bool $withSeconds = false ]) : mixed
Parameters
- $format : string
-
calendar format (e.g. "Y-m-d" or "Y-m-d H:i:S")
- $withTime : bool = false
-
activate time selection (default: false)
- $withSeconds : bool = false
-
show seconds (default: false)
Return values
mixed —showDnSelection()
Shows a DN selection next to input field.
public
showDnSelection() : mixed
Return values
mixed —getDataAttributesAsString()
Returns the data attributes as rendered string.
protected
getDataAttributesAsString() : string
Return values
string —data attributes
isAutoTrim()
Returns if the field content should be auto-trimmed (remove spaces at start/end).
protected
isAutoTrim() : bool
Return values
bool —auto-trim input