
上QQ阅读APP看书,第一时间看更新
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.
- 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.
- 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 ofexample.com)
. - 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.
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.
- 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