This hook is called after a successful form submission, but prior to the segue to the next thing.
As a quick primer, there are, at current, 3 different things which can happen after a successful form submission:
- Display a thank you message
- Display another form (aka Secondary ask)
- Redirect to another page anywhere on the internet
preSegue() happens before the transition to this next step so it’s useful for intercepting it and altering the behavior based on the submitted values and/or the response from the server.
It receives two arguments:
submitted_values- The values which were submitted across the network
response- The response from the server to that submission
confirmation- Object containing properties relevant to the form's post-submission behavior