Helpers
The helpers can be used on the form instance or every field and nested field.
- Field Selector
- Access Form Instance From Fields
- Get all Fields Values
- Get all Fields Errors
- Get all Fields Labels
- Get all Fields Placeholders
- Get all Fields Defaults Values
- Get all Fields Initials Values
- Get all Fields Types
Field Selector
.$('myFieldName');
Shortcut of
select()
Access Form Instance From Fields
Every Field
instance can access the Form
instance using the state
prop:
field.state.form // access Form instance
Get all Fields Values
Returns an object
with all fields key:val
pairs.
.values();
=> {
username: 'TheUsername',
password: 'ThePassword',
}
Shortcut of
get('value')
Get all Fields Errors
Returns an object
with all fields key:val
pairs.
.errors();
=> {
username: 'The Username Error',
password: 'The Password Error',
}
Shortcut of
get('error')
Get all Fields Labels
Returns an object
with all fields key:val
pairs.
.labels();
Shortcut of
get('label')
Get all Fields Placeholders
Returns an object
with all fields key:val
pairs.
.placeholders();
Shortcut of
get('placeholder')
Get all Fields Defaults Values
Returns an object
with all fields key:val
pairs.
.defaults();
Shortcut of
get('default')
Get all Fields Initials Values
Returns an object
with all fields key:val
pairs.
.initials();
Shortcut of
get('initial')
Get all Fields Types
Returns an object
with all fields key:val
pairs.
.types();
Shortcut of
get('type')