Forums

redirect difficulties

skittle 23 Jul, 2013
I have a Chronoform embedded in an article. It works well except that when I submit a record it appends
&chronoform=myFormName&event=submit
to the end of the current URL. Unfortunately this breaks the page. I have tried to fix this by using a Redirect action that references the appropriate URL in the onSubmit event but
&chronoform=myFormName&event=submit
is still appended to the URL. I have also tried a Custom Code action instead of the Redirect action but the result is the same. If I remove the appended information by hand in the browser's URL area and press enter (refreshing the page) I am returned to the appropriate page.

It seems like there should be a simple way to solve this. What am I missing?

As always, thanks for your help.

John
GreyHead 23 Jul, 2013
Hi John,

What do you mean by 'breaks the page'?

Bob
skittle 23 Jul, 2013
Hi Bob,

My chronoform is embedded in an article using the chronoform plugin. I am also using a plugin that allows a component to be placed in an article. So I have my chronoform and then a chronoconnection in the same article. Everything seems to work. The chronoconnection displays a list view of the records that are entered using the embedded chronoform. The problem is that when I enter a new record and press submit, the page refreshes and the chronoform disappears from the article. The chronoconnection still displays and even shows the new record that was added. At this point the URL has been appended with
&chronoform=myFormName&event=submit
If I remove the appended string from the URL by hand, the chronoform (as well as my chronoconnection) is displayed as expected.

I hope this is more clear. Thanks.

John
GreyHead 23 Jul, 2013
Hi John,

That sounds normal, after you submit the form it shows whatever output is generated in the On Submit action. You can re-load the form On Load event (or redirect to the page) if you want to re-show the form.

Bob
skittle 23 Jul, 2013
Thank you Bob,

I guess I am unclear on how to redirect to the page I want. I entered the correct URL in a Redirect action in the onSubmit section of the form. It is the last action in the onSubmit section. The output that is generated by the onSubmit event seems to be appended to the end of my redirect URL indicating that it happens after my redirect action. The question is, how do I redirect after the onSubmit event? Do I need to add a new event after the onSubmit event?

Thanks again,

John
skittle 23 Jul, 2013
Hi again Bob,

So in the meantime I tried:

manually changing the &event=submit that is appended (after form submission) to the end of my URL to &event=load in the browser URL area. This works!

But, how do I get the &event=submit that is appended to my URL after a submit event to say &event=load?

I have tried adding a Redirect URL action as the last item in the on Submit block but it doesn't seem to work.

For the redirect URL I have added:

http://mysite.com/index.php
as the target URL and

option=com_content
view=article
id=10
Itemid=163
chronoform=myFormName
event=load
as the Params/Fields map.

After submitting the record, I still get the same
&chronoform=myFormName&event=submit
string appended to
http://mysite.com/index.php?option=com_content&view=article&id=10&Itemid=163


Obviously, I am missing something here.

Thanks for your patience.

John
GreyHead 23 Jul, 2013
Hi John,

An Event Loop action at the end of the On Submit event will probably do the trick; or a ReDirect User action; or a Show Forms action.

Bob
skittle 23 Jul, 2013
Thank you Bob!

I am getting close now. The Event Loop action reloads the page but the form fields retain the values that were just submitted. I will try the other actions in hopes that the form refreshes with the fields empty unless you can steer me in the right direction first.

Thanks,

John
skittle 23 Jul, 2013
Thanks Bob,

It works! A completely empty redirect User in conjunction with the redirect URL did the trick.

I am now opening a new window in my browser so I can buy you some beer!

Thanks again for your help. Enjoy your six-pack.

John
GreyHead 24 Jul, 2013
Hi John,

Thanks, glad you got it to work OK.

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