gcanti / tcomb-form

Forms library for react
https://gcanti.github.io/tcomb-form
MIT License
1.16k stars 136 forks source link

Example of onChange at the field level? #293

Closed dukedougal closed 8 years ago

dukedougal commented 8 years ago

I can find lots of examples of doing on change at the form level, but no complete examples of how to do it at the field level.

For example I pass the following options into my form but the onChange function never fires.

const options = {
      fields: {
        source_location: {
          access_key_id: this.i18n.Kernel.form.access_key_id,
          onChange: this.onChange,
        },
      }
    };

Is there any fully complete examples showing how to make onchange functions work for specific fields?

thanks

gcanti commented 8 years ago

The onChange handler at the field level is reserved, please use the provided one at the form level (the path argument tells you which field is changed).