Redirect to a Page

The Redirect to a Page action redirects the website visitor’s browser to a chosen website address when they save or submit a form.

Adding a ‘Redirect to a Page’ Action

To add a ‘Redirect to a Page’ action:

  1. When editing your form, click the ‘Actions’  icon at the top of the page. The ‘Actions’ sidebar will open on the right-hand side of the page.
  2. Click the ‘Add’  icon to add a new action.
  3. Select ‘Redirect to a Page’ from the Action pulldown. A series of settings will appear.

As with all sidebars in WS Form, click to the ‘Save’ button at the bottom to save your changes, or click ‘Cancel’ to disregard your changes.

The available options are as follows:

When Should This Action Run?

You can redirect the website visitor when the form is saved, submitted, or both.

URL

Enter the URL you would like to redirect the website visitor to. This can be an absolute or relative URL.

For example:

  • Absolute: https://wsform.com/knowledgebase/
  • Relative: /knowledgebase/

Dynamic Redirect

It is possible to set the URL setting dynamically using a query variable. To do this:

  1. Drag a ‘Hidden’ field to your form (We suggest adding it under the ‘Submit’ button).
  2. In the ‘Default Value’ setting, enter: #query_var("r").
  3. Make a note of the Field ID shown in the top right, for example, #123.
  4. Click ‘Save’ at the bottom.
  5. Click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open on the right hand side of the page.
  6. Click the ‘Add’  icon to add a new action.
  7. Select ‘Redirect to a Page’ from the Action pulldown. A series of settings will appear.
  8. In the URL setting, enter: #field(123) where 123 is the Field ID of the hidden field you added. You can also click the variables icon to the right of the URL setting to find the field variable.
  9. Click ‘Save’ at the bottom.

The login will now redirect to whatever the ‘r’ query string parameter is set to.

An example login URL would therefore be:

https://wsform.com/log-in/?r=%2Fwelcome%2F

This URL would redirect to /welcome/ after a successful login.