...
1. How do I use onUpdate in the form widget?
onUpdate is a callback function invoked in the Form Source when any form fields get updated. It gives users access to currentValues following the change to update other values and the form’s fieldSettings. currentValues are already inputted in the available fields.
Ex.
| Code Block |
|---|
onUpdate: function (arg) {
if (arg.currentValues.state) {
var cityOptions = stateToCity[arg.currentValues.state]
arg.fieldSettings.city.dropdownOptions = cityOptions
}
return arg
}, |