Can a button affect the values in fields?

Can I used this same method to update multiple fields? How would the code look for that?