The Textfield is a small component for adding aria attributes and data binding to a HTML textfield. Typically this will be used in conjunction with a controller (e.g. Textfield Slider, Textfield Stepper) to restrict the values and pair with additional input methods.
Creator
Use the following function to create a Textfield component:
Method |
fluid.textfield(container, options);
|
---|---|
Description |
Instantiates the textfield component. Provides data binding between the HTML |
Parameters |
|
Returns | The Textfield component |
Examples |
|
Methods
setModel
Method |
textfield.setModel(event);
|
---|---|
Description |
The setModel method allows for updating the model value based on an event. This is
primarily used internally for binding to the input's change event.
|
Parameters |
|
Model Paths
The following model paths can be used with model listeners.
model.value
:undefined
by default but can contain any value that is valid for the input.
Options
strings
Description |
The strings option allows you to specify strings to be used by the component and is the
main location for localization. In particular this is used to set an "aria-label" to the
components container element, via the attrs option.
|
---|---|
Default | Nothing specified by default |
Example |
|
attrs
Description |
The attrs option allows you to specify attributes to be added on creation to the components
container element. In particular this is used to set aria attributes used by the component, such as
"aria-labelledby" .
|
---|---|
Default | Nothing specified by default |
Example |
|