0

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?

screenshot

3
  • I've tried the onEdit() in this post and it works fine. Please check if this would be helpful to you stackoverflow.com/questions/34050085/…
    – Kristkun
    Commented Dec 9, 2020 at 22:52
  • The onEdit() does the trick. Its not ideal, but a helpful work around. Thanks!
    – Tyler LV
    Commented Dec 11, 2020 at 17:44
  • Welcome! glad that i could help
    – Kristkun
    Commented Dec 11, 2020 at 18:17

1 Answer 1

0

I cleared this problem by making a checkbox. First the checkbox has data validation of having value in certain range. then the button only works if the checkbox is checked.

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jul 3 at 18:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.