Forums

Appending text to Submit URL

millermulti 02 Jul, 2014
Hello, I have been searching the forums trying to find an answer to my question with no luck.

I have three Chronoforms (V4) each is inside a Tabbed area on a page. I have the ability to display a tab as opened simply by adding a anchor link to the URL with the tab name. At the moment when I submit a form, the page reloads and the tab is closed so the user never gets to see the Thank you message which is hidden inside the now closed tab. The simple solution will be for me to append the text "#MyTabName" to the end of the Submit URL. I have tried some of the redirect options but am having no luck. Is there an easy way to do this? I am using SEF URLs so the URL after submission looks something like:

formpage.html?chronoform=my_form_name&event=submit
I need it to look like:
formpage.html?chronoform=my_form_name&event=submit#MyTabName

I have tried adding the following PHP code in an OnSubmit action with no luck.


<?php
    $MyForm->formrow->redirecturl .= '#MyTabName';
?>


Any suggestions would be greatly appreciated.

Thanks!
--Gary
millermulti 02 Jul, 2014
I tried using the Redirect URL and Redirct User actions with no luck. As I guess one would expect from a redirect, the form is processed and then the page reloads( redirects) causing me to lose the "Thank You" message instead showing a new blank form. The Redirect URL parameters also ignored my "#MyTabName" variable. I'm still looking for a way to modify the onSubmit URL with the event=submit.
GreyHead 02 Jul, 2014
Hi Gary,

Have you tried using a ReDirect User action at the end or the On Submit event with 'formpage.html?chronoform=my_form_name&event=submit#MyTabName' in it?

Bob
millermulti 02 Jul, 2014
Answer
Thanks for the reply Bob. I had not tried that variation. My understanding is that by using the ReDirect, the form will submit and then redirect itself, in this case to the same page, thus causing the page to reload which will cause the Chronoform Thank you message to be skipped. Instead you get a fresh form reload. I'm thinking that adding the URL in the redirect will solve the open tab issue but results in the lost thank you message. I did find a different solution.

After looking through the forum some more I found a posting from someone with the same question and their answer. (http://www.chronoengine.com/forums/posts/f26/t93586.html). The solution is pretty easy. As I know the full submit URL, I simply copy it and then go to the form configuration page, paste it into the Submit URL box and append my Anchor link tag to the end. I have tested and this method works perfectly. Similar to the ReDirect, but occurs on the original submit.

Thanks again!
This topic is locked and no more replies can be posted.