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
javascript
.$('myFieldName');Shortcut of
select()
Access Form Instance From Fields
Every Field instance can access the Form instance using the state prop:
javascript
field.state.form // access Form instanceGet all Fields Values
Returns an object with all fields key:val pairs.
javascript
.values();=> {
username: 'TheUsername',
password: 'ThePassword',
}Shortcut of
get('value')
Get all Fields Errors
Returns an object with all fields key:val pairs.
javascript
.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.
javascript
.labels();Shortcut of
get('label')
Get all Fields Placeholders
Returns an object with all fields key:val pairs.
javascript
.placeholders();Shortcut of
get('placeholder')
Get all Fields Defaults Values
Returns an object with all fields key:val pairs.
javascript
.defaults();Shortcut of
get('default')
Get all Fields Initials Values
Returns an object with all fields key:val pairs.
javascript
.initials();Shortcut of
get('initial')
Get all Fields Types
Returns an object with all fields key:val pairs.
javascript
.types();Shortcut of
get('type')