Skip to content

How do I run some code when a specific form's submission is successful? #606

Answered by adam12
panda-madness asked this question in Q&A
Discussion options

You must be logged in to vote

I'm assuming you're not returning an empty form upon successful submission?

You can modify the render options to provide an onFinished callback.

up.on('up:form:submit', (event, el) => {
  const form = el.form
  event.renderOptions.onFinished = () => {
    form.reset()
  }
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@panda-madness
Comment options

Answer selected by panda-madness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants