Dynamically Update one field based on another field #1281
-
How would someone dynamically update one field based on the value of another? lets say I have a json schema like this:
If the user changes Another example of this is having an autocomplete dropdown from google maps dropdown to select an address and fill in other fields that exist later in the form (shipping zip code for example) How would I accomplish this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @austinh, Reacting to field changes
There are a few approaches to this, but there is one limitation for sure - you can't achieve this using schema only. This needs to be handled in the implementation. Let's review a few possibilities that we have: Overriding
|
Beta Was this translation helpful? Give feedback.
Hi @austinh,
Reacting to field changes
There are a few approaches to this, but there is one limitation for sure - you can't achieve this using schema only. This needs to be handled in the implementation. Let's review a few possibilities that we have:
Overriding
AutoForm.onChange
- from the form perspectiveYou can override the
onChange
by extending theAutoForm
class and reacting to particular field key changes.With custom field(s) (
useField
twice…