Rather often I create somewhat dynamic forms that have a variable number of fields. One of the problems I run into is how to figure out which fields need to be updated in the database.
I wrote a quick UDF to help solve this problem called structCompare. You pass it two structures with the same set of keys, and it will return a list of keys that have differing values in the two structs. You can download the code here.