I have a form with few data fields and two buttons.I want to enable the buttons only if the user makes some changes to the form. I have tried using:
this.for
You can compare your object against the result of the form when submitting
let changes = false;
for ( let [ key, value ] of Object.entries( this.form.value ) ) {
const form = this.form.value;
const record = this.record;
if ( form[ key ] != record[ key ] ) {
changes = true;
break;
}
}
if ( !changes ) {
// No changes
} else {
this.record = this.form.value;
this.UpdateRecord();
}