I have a large form about customer details which contains around 50 fields. A customer can update his information, like address and contact number. When he edits his profile, he is presented with all 50 input fields editable. When he edits for example only address field, I want to determine the modified field on the POST so that I send only those fields to the underlying system (SAP).
This is what I have done so far,
- Update all 50 fields in the system, because I am unable to determine which fields have been modified.
- To determine modified fields only, I maintained 50 more fields in the viewModel and upon post compare relevant fields to determine which fields are modified.
But as obvious, these both methods are poor design practices plus they add extra overhead to performance.
I want to know, how can we determine the modified fields upon POST so that I only send update request for the modified fields only.
Appreciate your insights on this.