Forums

Trying to get captcha + registration + confirmation page?

infernooo 29 Aug, 2011
Hi everyone,

I was hoping someone could provide some assistance...

I am running Chronoforms 4.0 RC1.9 on Joomla 1.5.23.

I have a form that is used for registration at my website, and it contains a captcha verification at the bottom. In addition, I want to load a confirmation page after clicking submit on the first page which then displays the entered data and allows the user to go back (or if it makes things easier, re-enter it on the confirmation page) in case they have entered anything incorrectly. After clicking "Submit" to verify that everything was correct, I want it then to register them.

I have gotten it working without the verification step (i.e. simple registration), but am having issues understanding how to get everything working together when I add the confirmation step.

Following is a screenshot of how I have the backend setup. The issue I am facing is once you click submit on the second page (the confirmation page), I am thrown to a page that redisplays the form and at the top has in pink/red "1. You have entered an incorrect verification code!".



Any suggestions?

Thank you in advance!
GreyHead 29 Aug, 2011
Hi infernoo,

It sounds as though the Joomla! Registration is failing and the OnLoad action there is returning you to the Show HTML again. But I don't understand what the Captchs error message is displaying there :-(

FWIW I also find the action flows difficult to track when the Confirmation page is being used. I think this is because the Confirmation page effectively included an OnLoad action when it re-displays a version of the form.

I think my next step would be to add a little debugging code. Drag Custom Actions in and add a code snippet like this
<div>This is the Confirmation Page OnFail event</div>
or better
<?php
$mainframe =& JFactory::getApplication();
$mainframe->enqueuemessage('This is the Confirmation Page OnFail event');
?>

These can be invauable in mapping exactly where you are and where the error message is coming from.

As a more general comment I think it is best to keep the On Success actions to a minimum; if the action succeeds then the next action in the Event box will be executed so I'd put the Registration action back into main sequence after the Confirmation page action.

Bob
infernooo 29 Aug, 2011
Thank you for the reply!

Where should I put that custom code?

Also I have moved the registration back into the main submit section as you suggested.

Finally, the error "1. You have entered an incorrect verification code!" is the custom error message I used for the "Check Captcha" action on submit.
GreyHead 29 Aug, 2011
Hi Infernoo,

For code snippets like that Drag Custom Code actions into the places you want them; you an always delete them later.

Bob
infernooo 29 Aug, 2011
OK, thanks to that debugging code, it appears to be hitting the "OnFail" of the Check Captcha action after I click Submit on the confirmation page. Not sure where to go from here.... should I be doing something with the session to data/data to session or the form data?
Max_admin 30 Aug, 2011
Hi infernooo,

Please check my post here:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=26&t=22976&p=75748#p75546

You need to change the position of the "Data to Session" action.

Let me explain something, when you submit the confirmation page itself, the event "on submit" will be recalled once more, so your actions before the confirmation page will be reprocessed, I believe that you should drag all your actions before the "confirmation page" inside the "on show" event, and I'm not sure if this will work, please try it and let us know.


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
infernooo 30 Aug, 2011
I believe what is happening is that the data is entered in the form (lets call this the first page). I then click submit and it goes to the "On Submit" section of the form, which starts with the captcha check, and then the confirmation page. Upon clicking Submit on the confirm page, the form is being called again starting at the top of the "On Submit" section, however the form data has not been saved, so the captcha is failing as the form data is now empty:

Array
(
[confirmation_page] => _confirm
[option] => com_chronoforms
[chronoform] => signupstep1
[event] => submit
[Itemid] =>
)

As compared with the data after clicking submit on the first page:

Array
(
[username] => testuser
[password] => fakepass
[password2] => fakepass
[title] => Mr
[firstname] => Test
[middlename] => test
[lastname] => test
[email] => [email]test@test.com[/email]
[phone] => 234
[mobile] => 234
[address1] => 234
[address2] => 234
[state] => asd
[postcode] => 123
[country] => qwe
[chrono_verification] => SRiuD
[submit] => Submit
[7f8a71348f50ca7cbed4382ed20c5e76] => 1
[option] => com_chronoforms
[chronoform] => signupstep1
[event] => submit
[Itemid] =>
)
Max_admin 30 Aug, 2011
Hi infernooo,

Exactly, that's what I have just explained, did you do the changes I suggested ? once you do and test them please let me know the results and post a screenshot for your new events tab.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
infernooo 30 Aug, 2011
Sorry, that was an unintentional double post.

Thank you for the reply, I really appreciate you both helping me out😉

I have changed to the following:



Now when I click Submit on the confirm page, I am kicked into the "Event Loop" within the "OnFail" within the "Registration" within the "On Confirm" within the "Confirmation Page" within the "On Submit" action. The error now is:

You must provide your firstname.
You must provide your username.
You must provide your email.
You must provide your password.

Array
(
[confirmation_page] => _confirm
[option] => com_chronoforms
[chronoform] => signupstep1
[event] => submit
[Itemid] =>
)

Looks like the data is still not making it through...
Max_admin 30 Aug, 2011
Hi infernooo,

Please remove the "Data to Session" at the top of the "on submit", we have already placed another one in the "on show"

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
infernooo 30 Aug, 2011
I just tried that but am seeing the same issue as in my last post😟

Edit: Got it working... there should be session to data in onload, data to session in "on submit"->"confirmation page"->"on show" and session to data in "on submit"->"confirmation page"->"on confirm".
Max_admin 31 Aug, 2011
Hi infernooo,

I don't think you need the "Session to Data" in the "on Load".

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 31 Aug, 2011
Hi Max,

I'm pretty certain that is needed to reload the data when the Confirmation Page is displayed. It's not needed for the normal page load but does no harm.

Just for tidiniess the session data should be cleared in or after the final OnSuccess event. Otherwise it relaods if you re-use the form in the same session.

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