set
Sets the value of the form field with the specified name.
set(name?: keyof TData, value?: any, validate?: boolean): this | undefined
Summary
This method sets a form field to the provided value. If the value is different from the current value of the form field, or if the validation result has changed, a change event will be emitted on the form context object itself.
The field value may be converted to a different type if needed:
- If the field was initialized with a number value, the value is converted to a number. If the result is NaN, the field value is set to undefined instead.
- If the field was initialized with a boolean value, the value is set to true or false directly.
Parameters
- name — The name of the field to set
- value — The new field value
- validate — True if validation tests should be run for this field, if any
Related
- class UIFormContextAn object that contains form field data along with validation tests.