Forums

Back link doesn't display page template

tomaszciti 17 Feb, 2020
Hi

I'm working on a new form in v6 (Joomla CMS with SH404SEF plugin ) - it's a multi-page form using AJAX. The form URL is "/order-packs".

I have added back links to show previous page / event and they are working but the page template (HTML & CSS) is not loaded, just the form area when "Back" buttons are used e.g.



I have been experimenting and the page template is not loaded with the default URL displayed once Back button is pressed e.g.

/order-packs?chronoform=order&event=load&tvout=view&load-form[counter]=0&_counter=0

But when I edit it manually to just:

/order-packs?chronoform=order&event=load

the page template is displayed OK, but the form loses data.

What am I missing in the settings to have the page template loaded when Back links are pressed?
healyhatman 17 Feb, 2020
tvout=view means "load the event without any template or css"
tomaszciti 18 Feb, 2020

tvout=view means "load the event without any template or css"


Thanks. "tvout" is added automatically to the URL by Chronoforms 6.

Any ideas how to disable this?
healyhatman 18 Feb, 2020
Why would it be added automatically? Can you screenshot how you're setting up this back link please?
tomaszciti 18 Feb, 2020

Why would it be added automatically? Can you screenshot how you're setting up this back link please?


The form is loaded on the "/order-packs" URL. When "Next / Submit" buttons are used the URL doesn't change due to AJAX. The form settings:




The 1st page/event is called 'load'. And the Back link to it is as follows:









When Back is pressed the result is:



There is no template loaded. The URL changes to /order-packs?chronoform=order&event=load&tvout=view&load-form[counter]=0&_counter=0
healyhatman 18 Feb, 2020
Put the name of the form in the "result" and "target element" fields maybe, because you're basically wanting it to get the result from ajax and then put the result in there.
tomaszciti 19 Feb, 2020
Yes, on the "Events" tab though there are some interesting options . When "On click" is set to "Default Behaviour" and the back button is used, the page is displayed without template.

When "On Click" is set to "Load new content" and with:




I get the template loaded when the Back button is used with the unchanged URL ie /order-packs. The problem is I get two forms displayed on the page, not one that should only be shown so one of them needs to be removed.

I tried to put a form name (in my case it's 'address-form') in the "Target element" field of the "Remove content settings" section but that did not work.
tomaszciti 19 Feb, 2020

Put the name of the form in the "result" and "target element" fields maybe, because you're basically wanting it to get the result from ajax and then put the result in there.


When I put a form name or event name in "Result" the back button doesn't work at all - no JS errors in the console.
healyhatman 19 Feb, 2020
Sorry for result try
replace/formname
tomaszciti 19 Feb, 2020

Sorry for result try replace/formname


I have tried to put "replace/address-form" and "replace/address" and in both cases back button doesn't work . If I put just "replace" in the Result field I still get 2 forms but at least buttons are where they should be - without it buttons from all forms where together at the bottom of the page.
healyhatman 19 Feb, 2020
Answer
OK I got it!

On Click: Load new content
Target: blank
Result: replace/closest:form.ui.form

You can use whatever identifier you want but closest:form.ui.form will get the closest chronoform
tomaszciti 20 Feb, 2020

On Click: Load new content

Target: blank

Result: replace/closest:form.ui.form



Yes, this is working. Many thanks.
This topic is locked and no more replies can be posted.