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 widget, assign it to the onFieldDataChanged option when you configure the widget.

JavaScript
$(function() {
    $("#formContainer").dxForm({
        onFieldDataChanged: function (e) {
            var updatedField = e.dataField;
            var newValue = e.value;
            // Event handling commands go here
        }
    });
});

If you are going to change event handlers at runtime, or if you need to attach several handlers to the fieldDataChanged event, subscribe to this event using the on(eventName, eventHandler) method.

JavaScript
var fieldDataChangedHandler1 = function (e) {
    var updatedField = e.dataField;
    var newValue = e.value;
    // First handler of the "fieldDataChanged" event
};

var fieldDataChangedHandler2 = function (e) {
    var updatedField = e.dataField;
    var newValue = e.value;
    // Second handler of the "fieldDataChanged" event
};

$("#formContainer").dxForm("instance")
    .on('fieldDataChanged', fieldDataChangedHandler1)
    .on('fieldDataChanged', fieldDataChangedHandler2);
See Also