Forums

Redirect to joomla article after form submission

terrywest 04 Nov, 2011
Hi,

Having an problem trying to use the ReDirect URL, On Submit event.

I am basically trying to use a drop down box value to redirect a user to the related Joomla article.

In the Drop down box I have configured a couple of options like this (with the number reflecting the article ID):
27=Sydney
29=New York

Then in the redirect URL parameters box I am putting something like this:

Target URL
http://www.mywebsite.com/index.php
parameters
option=com_content&view=article&id=27={input_select_0}

However when using the form I then get redirected to the URL:
index.php?option=com_content%26view%3Darticle%26id%3D27%3D%7Binput_select_0%7D

I assume this is because of the additional Ampersands and equals signs, so I tried escaping them correctly but this didn't work. I tried adding more of the URL to the drop down box value but that causes problems too.

I also have SEF URLs turned on and tried using these as values, but this will not work due to the added ?= before the value which causes the URL to obviously be wrong.

So is there something wrong with the values I'm using in the form or am I just trying to achieve this in the wrong way. Should I be creating a PHP script to do the work and use the redirect to point to the script, r can this all be done from within chronoforms.

Many Thanks
GreyHead 04 Nov, 2011
Hi terrywest,

In the ReDirect URL box each parameter + value pair needs to be on a separate line
option=com_content
view=article
id={input_select_0}

Bob
terrywest 05 Nov, 2011
Hi Bob,

Thank you, seems so obvious now... works like a charm to.

I little tip to anyone else trying to achieve something similar in Joomla 1.6+

In some templates when you will find you get an additional H1 Heading 'Articles' when viewing the page in this way. To remove this you will need to add the following to your languages override file:

JGLOBAL_ARTICLES=""

more info available here http://forum.joomla.org/viewtopic.php?p=2410615#p2410615


Terry
This topic is locked and no more replies can be posted.