JavaScript/jQuery Form - Handle the Value Change Event

To process a new form item value, you need to handle the fieldDataChanged event. If the handling function is not going to be changed during the lifetime of the UI component, assign it to the onFieldDataChanged property when you configure the UI component.

App.js
  • import React from 'react';
  •  
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { Form } from 'devextreme-react/form';
  •  
  • class App extends React.Component {
  • constructor() {
  • super();
  • this.formFieldDataChanged = this.formFieldDataChanged.bind(this);
  • }
  •  
  • render() {
  • return (
  • <Form onFieldDataChanged={this.formFieldDataChanged}>
  • {/* ... */}
  • </Form>
  • );
  • }
  •  
  • formFieldDataChanged(e) {
  • const updatedField = e.dataField;
  • const newValue = e.value;
  • // Event handling commands go here
  • }
  • }
  •  
  • export default App;
See Also