angularformio

Is it possible to trigger an event when a form field value in formio form changes?


I am using formio angular to render a simple form. The form has a birthday field and when initialized, it has a default value and if it is changed, is it possible to emit an event if the default value has been changed ?


Solution

  • Yes, it is possible.

    <formio
      [form]="formDefinition"
      (change)="onChange($event)"
    ></formio>
    

    You can subscribe for the change event which will emit whenever a value in the form is altered.