InputfieldText class

An Inputfield for handling single line “text” form inputs

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the InputfieldText class also inherits all the methods and properties of: Inputfield, WireData and Wire.

Show class?     Show args?       Only hookable?    

Properties

NameReturnSummary 
InputfieldText::autocomplete string null HTML5 autocomplete attribute, used only by text and email, not other descending types 3.0.252+
DEFAULT: null
 
InputfieldText::initValue string Optional initial/default value
DEFAULT: blank
 
InputfieldText::maxlength int Maximum allowed length of value or 0 for no min
DEFAULT: 0
 
InputfieldText::minlength int Minimum allowed length of value or 0 for no max (usually combined with 'required' option)
DEFAULT: 0
 
InputfieldText::noTrim bool By default whitespace is trimmed from value, set this to true to bypass that behavior .
DEFAULT: false
 
InputfieldText::pattern string HTML5 pattern attribute for front-end validation
DEFAULT: blank
 
InputfieldText::placeholder string Placeholder attribute text
DEFAULT: blank
 
InputfieldText::requiredAttr bool int When combined with "required" option, this also makes it use the HTML5 "required" attribute.
DEFAULT: false
 
InputfieldText::showCount int Show a character counter (1) or word counter (2) or neither (0). Recommended value is 1 when using minlength or maxlength.
DEFAULT: 0
 
InputfieldText::size int Size of input or 0 for full width
DEFAULT: 0
 
InputfieldText::stripTags bool Should HTML tags be stripped from value?
DEFAULT: false
 
InputfieldText::type string Input type
DEFAULT: text
 
InputfieldText::useLanguages bool When combined with multi-language support, setting this to true will provide one input per language. Get/set each language value with the "value[languageID]" property, and just "value" for default language.
DEFAULT: false
 

Additional methods and properties

In addition to the methods and properties above, InputfieldText also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252