Search code examples
formio

Redirect after submission (in hosted version of Form.io)


Can we redirect to another page/form after successful form submission, in the cloud version of Form.io? I'm thinking about redirecting to another form after a user authenticates but this would also be used to more general page navigation too.

I can't see any Actions that would do this, and I don't think (please correct me if I'm wrong) I have access to the events discussed in the tutorials for the self-hosted version.

Thanks


Solution

  • This can be done by attaching an event handler on the form renderer and then manually redirecting after the form has submitted. Assuming you are using ng2-formio as your renderer, you would do this as follows.

    <formio src="https://examples.form.io/example" (submit)="(function(submission) {
    
      window.location.href = 'https://form.io';
    
    })($event)"></formio>