ChronoForms 3.1 for Joomla! site Cookbook
上QQ阅读APP看书,第一时间看更新

Redirecting the user to another page

In an earlier recipe we created a "Thank You" page to display after the form is submitted. Sometimes though you may want to take the user to some other page on your site. We can do this too.

In this example we'll redirect to the site home page for simplicity. You can do exactly the same using any other URL on the site.

Getting ready

We'll be using that same form again.

How to do it...

  1. From the ChronoForms Forms Manager select the newsletter_signup checkbox and click the Wizard Edit icon in the toolbar, then close the warning message. This time go to Step 4 - After form Submission.
    How to do it...
  2. In the Redirect URL box, just type index.php or, if you prefer, http://example.com/index.php (but using your domain name in place of example.com).
  3. Save the Form here, go back to view the form in the browser, and submit it. Now, instead of the "Thank You" page we are redirected to the site home page. You could choose to write a "Thank You" page as an article on your site, or take the user to some other page that you think might be relevant or interesting to them.

    Tip

    Notice that in the preceding screenshot there's a help bubble; you can see these throughout ChronoForms by hovering your mouse over the blue tooltip (i) icons. Some of these are more helpful than others but it's always worth taking a look if you are uncertain of how something works.

There's more...

There is nothing to stop you from using any URL in there; you can redirect your user to any other page on the internet. And, as we shall see later, you can create redirect URLs dynamically to send the user to different pages depending on the information they submit in their form.

See also

  • Chapter 6 has a recipe Redirecting users to other Joomla! pages after submission that looks at other ways to redirect
  • Chapter 11 has a recipe Creating a PayPal purchase form with the ReDirect plug-in that looks at redirecting the user with some of the form data