I have a google sheet setup as a form with an image/button attached to a script. If the user clicks the button while they are editing a cell the script executes without updating the cell's value. The problem is that the user doesn't always hit "Enter" between filling out the information in the last cell and clicking the Submit button.
Is there a piece of code I can add to the script to update active cells before executing?