How to Light up a "Save" button after data has changed?

LOGGIX - Jeroen:
Anybody, I would like to highlight a SAVE button only when data on a previously filled page is changed. So the SAVE button, when entered the page is grey and after an edit is should right away turn green. What is the best practice for this when I do not want to use a OnChange on every field (got a lot of fields).


Neil Manchester:
I do this by saving the selected data object into my model twice. So I have something like model.selectedNote and model.selectedNoteOnOpen. All of the fields are the set to update model.selectedNote.x etc.

Then just use conditional formatting on your button to make it grey if model.selectedNote!=model.selectedNoteOnOpen. Or use a v-if else to show the grey button with no named action if they’re equal but your active button with your Save named action if changes have been made


LOGGIX - Jeroen:
Thanks Neil, that was my thought exactly but sounded a bit like a work-around… but let me give it a try!


Delfs:
Not much work, when the data loads have some js:

model.origionaApplication = model.application

Delfs:
hmm you may need to break the reference JS creates to the original like this:
model.origionalApplication = _.clone(model.application)


https://examplesdev.fmbetterforms.com/#/form/FR_1CBF014D-FBC3-7D43-9BBE-F458C7964FB0?refresh=0.6300572367561903

you can find this example by searching Detecting changed data