Forums

Captcha causing infinite loop and sendig 1000 mails and more..

Emerahl 11 Dec, 2014
Hello,
when I add a captcha to my form, this causes an infinite loop - the site is hanging and more than 1000 Mails will be sent (I stopped the site, otherwise it would be never ending), when I filled the form and captcha and pressed the submit button.

I suppose that I have made a little mistake when I set up the captcha... I have custom html and did the things the Chronoengine team recommended to add a captcha described in http://www.chronoengine.com/faqs/55-cfv4/cfv4-anti-spam/3014-how-can-i-add-a-chronoforms-captcha-to-my-custom-html.html

After inserting the captcha's html I put the Load Captcha action into the OnLoad Event and the Check Captcha and Event Loops actions in the On Submit event ....
Do I have to choose on submit or on load in the event loop - can a wrong choice cause this error?

For your information: I am also using the AutoJavascriptValidation for some fields. And of course - at the moment I removed the captcha from the site, as it is causing this mess.

Or did I do everything right, are there possibly any compatibility problems with my template (Cepon) and its features?
I would be glad, if you could help me, many thanks in advance!
Emerahl 12 Dec, 2014
Hi there,
during the afternoon, I have tried something and found out the following, even more confusing somehow...
I have set up a new form as a test form.
When I added the captcha, load captcha and event loop, it seemed to work... but I tested severel possibilties and that's what happened:
To say before: I am not really sure what to use on the event loop: OnLoad, OnSubmit, OnSubmit > CheckCaptcha > OnSuccess or OnSubmit > CheckCaptcha > OnFail
When I use the last both ones, everything seems to be alright, but nothing is checked, and the form is sent even if the captcha is wrong or missing. And after submitting the form, the form is displayed filled again below the thanks message, that is not good...

When I use onLoad, everything seems to be ok, but I got two mails, when I put in a wrong or no captcha also the first time, which means - I suppose - that the form is sent the first time, although the code was wrong. But this seems not to happen always.

The horrible thing with thousands of mails is happening again, when I use the onSubmit option in the EventLoops....

I would be realle glad, if anyone knows any solution....
I wondered if there something went wrong when I installed Chronoforms, I am working with it for over 5 years and something strange like this never happened before....

Thank you and best regards
Anne
GreyHead 13 Dec, 2014
Hi Emerahl,

The default setting for the Event Loop - which points back to the On Load event of the form - is the one you need.

If you set the Event Loop to point to the even that it is in then, as you found, it just goes round in a loop.

The Email problem is most likely because you have the Email action before the Check Captcha action - so it sent whether or not the Captcha is OK. ChronoForms is pretty logical like that, the actions are run in the order they appear in the event.

Bob
Emerahl 15 Dec, 2014
Hi Bob,
thank you for your answer... I already supposed that it would be a "order" mistake like this. I just have to get used to the captcha as in former forms, it was not wanted.

I put the Event Loop on the OnLoad and there is no Loop anymore... but nevertheless, when I put the Email action behind the CheckCaptcha, the form is sent even though I put in a wrong code. It is like this: I put in the wrong code and get the message, that the code is wrong and when I then put in the right code, everything seems ok, but I receive both form mails, the first input with the wrong and the second with the right one.

The other problem with is, that when I sent the form with the right code, I get the thanks message on the page, but under it, the form - filled with the sent data - is dispayed. On my other forms without captcha, there is just shown the thanks message, when the form has been sent.

Is there still something in the wrong order? This is my events' order:
onLoad:
Load JS
Load CSS
Auto JavaScript Validation
Load Captcha
Show html

onSubmit:
Custom Code
Handle Arrays
CheckCaptcha
Email
Show Thanks message
Event Loop

... perhaps there is still something wrong or not needed? In the Event Loop configuration, "Quit next actions" is "Yes".

Thank you in advance and lots of greetings!
GreyHead 15 Dec, 2014
Answer
1 Likes
Hi Emerahl,

The Event Loop goes into the pink ON Fail event of the Check Captcha action. And the Check Captcha shuld be the first action in the On Submit event.

Please see the image below (it is for a Check Honeypot but the Event Loop is the same as for a Check Captcha).

Bob
Emerahl 15 Dec, 2014
Hi Bob,
that is really great - it is working! I did not know that I had to put the Event Loop into the CheckCaptcha, but of course - it is logically!
Everything is fine now, only the form with the correct code sent, the thanks message shown after submitting without displaying the form below, it is super, super!

I will buy you a coffee, when I have done this with all my "real" forms, the other was a test form...

Thank you so much and have nice days before Christmas

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