Forums

Confirmation page doesn't lead to Thanks Message

HerKle 08 Feb, 2012
My construction so far worked fine - until I included the confirmation page.
When clicking the "Submit" button, the side doesn't show the "Thanks" message, but goes back to the form (with blank input and ReCaptcha error message). What did I forget to make it work?
[attachment=0]Confirmation page problem.png[/attachment]
GreyHead 08 Feb, 2012
Hi Herkle,

I recommend that you don't use the action On Success events unless you are forced to (because not all of them work and because the nesting gets hard to understand). Instead put the OnSuccess actions in sequence in the main On Submit box. The result is the same; if the action does't fail then control passed to the next action in the main event.

Unfortunately you can't re-position the actions by dragging and dropping but you can copy and paste the settings over using two browser windows.

Bob
HerKle 08 Feb, 2012
I cleaned up all the nested mess as you have recommended - yet the original problem remains:
Clicking the button "submit" on confirmation page redirects to blank form with error message "The reCAPTCHA wasn't entered correctly. Please try it again."
[attachment=0]Confirmation-page-problem.png[/attachment]
GreyHead 09 Feb, 2012
Hi Herkel,

Hmmm, ReCaptcha is usually pretty reliable. Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.

Bob
HerKle 09 Feb, 2012
Here it is.
GreyHead 09 Feb, 2012
Hi HerKle,

There are no problems here with the ReCaptcha. Is the site connected to the Internet?

Oops - ignore that, I answered too quickly.

Bob
HerKle 09 Feb, 2012
It's a local test environment.
But ReCaptcha is only on the form page installed - not on the confirmation page. So the step from confirmation to thanks message page should run without any ReCaptcha at all, shouldn't it?
And the first step from form to confirmation (where I expect it) ReCaptcha works fine, even locally.

It's the second step from confirmation to thanks message, which doesn't work.
GreyHead 09 Feb, 2012
Hi herKle,

I worked it out. I don't know why we haven't seen this problem before, there ought to be a simple solution but I can't see it.

Having asked you to un-stack your events I'm going to ask you to re-stack some. The form needs to skip the ReCaptcha check and the ServerSide validation after the Confirmation page.

I added one line to the end of the code in the Confirmation Page action to flag up that it is a Confirmation submission:
<input type='hidden' name='confirmation' value='yes' />


Then I used an Event Switcher [GH] action to cehck for this value
<?php
if ( !isset($form->data['confirmation']) || $form->data['confirmation'] != 'yes' ) {
  return 'event_a';
}
?>


Lastly I moved (or copied and replaced) the Check ReCaptcha and Suto Serverside Validation actions into the Event A box of the Event Switcher.

This does what we want and only runs the checks when the form is first submitted.

Bob

PS As I'm writing this it occurs to me that it would be neater to use a different event for the Confirmation Page submission. It would have the same result. BUT I'm not sure how to do that without hacking the code. Added to the To Do list.
HerKle 09 Feb, 2012
Hm. What I understood of your last reply looks now like this (including the code you gave me):
[attachment=0]Confirmation-page-problem.png[/attachment]

But this is now even worse. After entering the captcha on the form, both the confirmation AND the form open on one page. After confirming now the thanks message appears (yoohoo!), but the data are gone (there are the field names shown in curled brackets).

Could you make a screenshot of the events' construction so that I can follow more correctly? Thanks for your patience.
GreyHead 09 Feb, 2012
Hi Herkle,

That looks OK but move the Event Switcher up before the Confirmation Page action.

The missing Data may be from the Data to Session in the On Show event - at a guess that's wiping out the previously saved data, you prbably don't need it.

Bob
HerKle 09 Feb, 2012
There is a certain progress...
The steps are following now the right order.

But still the thanks message page shows curled brackets.

My code in Custom Server Side Validation checks and changes some data. Shouldn't they somehow get into the session data before the (db recording and) thanks message procedure occur?
GreyHead 09 Feb, 2012
Hi HerKle,

Sure - it needs to be set to Merge data to make sure that the existing data is carried through. Adding Debugger actions temporarily may make it clearer what data is available where.

Bob
HerKle 09 Feb, 2012
I don't find any action to "merge data". Where do I have to set it?

With the debugger I see after "submit" on conf page:
Array
(
    [confirmation] => yes
    [confirmation_page] => _confirm
    [chronoform] => registration
    [event] => submit
    [Itemid] => 509
    [option] => com_chronoforms
    [view] => form
)

So the loss happens there somewhere.
HerKle 10 Feb, 2012
I got it solved. In case, others face the same problem, here is my construction, which works fine.
[attachment=0]Confirmation-page-problem-solved.png[/attachment]

Thanks for your help!
GreyHead 10 Feb, 2012
Hi HerKle,

Great to see that you got this working.

I think I got this bit wrong earlier but for other readers here's the correct version:

The 'Data to Session' action has a 'Merge data' setting. If this is set to Yes then the data saved to the Session is merged with any existing Session data with the new data taking priority; if it is set to No then any existing data is deleted and the only the new data is saved.

The 'Session to Data' action has a 'Clear after' option. If this is set to Yes then the data is cleared from the session when the action runs; if it's set to No then the data is preserved in the session.

Bob
jmarian1 15 Feb, 2012
Hi Bob,

Thanks to HerKle for sharing how his form works using the Confirmation Page. It's a great tutorial for beginner and for refreshing. Anyway, I tried to use it in my form and I like how it works. However, the data in my second double drop down select is not showing when I click the "back" button. Also, when I click the "submit" button again after clicking the "back" button, the DB record loader that supposed to show some data after selecting the school doesn't show or get the data that need in the confirmation page. By the way, I used the double drop down page tutorial in v4 and it works great. Please help. Here is my URL for the form http://auw.org/doe/index.php?option=com_chronoforms&chronoform=principal2. I send you an email regarding the multiple page form and has some information in the back end. If I can make this work, I'd rather use this. I guess it is easier. Please advice and hope to hear from you soon. Thanks.

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