Forums

Captcha for Custom Form

chumby 30 Apr, 2012
Hi there,

I would like to add a Captcha element to a custom form.

I have created a simple new wizard form, copied the code, and pasted it into my main custom form.

It displays ok... but the form is always submitted - the captcha part is not working...

Anything I can do to fix?

Cheers
Chumby
GreyHead 30 Apr, 2012
Hi Chumby,

Have you added the Load Captcha and Check Captcha actions?

Bob
chumby 30 Apr, 2012
Yes Bob,

Followed the video and got it working all ok. Then viewed the code (it was just one section of ) and pasted it into the bottom of my other form....

No good though...

Appreciate the help.

Cheers
Chumby
chumby 30 Apr, 2012
Hi Bob,

The code below is from the test form where the captcha works fine. I just copy and paste this into my other custom form, but it doesnt do its job. Also, the nice font size is not carried over either.

Does this help at all? Is there a setting in my custom form that I need turned on/off?

I have embedded this code in some <tr><td> tags - just for consistency with the rest of the form. This shouldn't make any difference... should it?

Cheers
Chumby


<div class="ccms_form_element cfdiv_text" id="autoID-612c003ec40ada2d32ad16147a14ce1b_container_div"><label>Enter the code</label><input maxlength="5" size="5" class="chrono_captcha_input" title="" type="text" value="" name="chrono_verification" />
{chronocaptcha_img}<div class="clear"></div><div id="error-message-chrono_verification"></div></div><div class="ccms_form_element cfdiv_submit" id="autoID-eafb92aee43e00b9723a4e6c59b8108c_container_div"><input name="input_submit_1" class="" value="Submit" type="submit" />
<div class="clear"></div><div id="error-message-input_submit_1"></div></div>
GreyHead 01 May, 2012
Hi chumby,

I just tested this, pasted your code into the Code box of a form, added the two actions plus an Event Loop for the On Fail event and it all works OK.

Bob
chumby 01 May, 2012
Hi Bob,

So these "added the two actions plus an Event Loop for the On Fail event " need to go on the custom code form as well?

Thats what I would be doing wrong then...

I'll try that.

Cheers
Martin
GreyHead 02 May, 2012
Hi Martin,

Yes, the 'Custom Code' is only for the Form HTML, all the actions still have to be added in the same way as a Wizard form.

Bob
jjspelman 18 Jul, 2012
Cool, thanks, Bob. Just what I needed to see for the 6 custom forms I need to add captcha to.

Question: Should I change the 'id' in
<div class="ccms_form_element cfdiv_text" id="autoID-612c003ec40ada2d32ad16147a14ce1b_container_div">
for each of the different forms, or does it matter? I just copied the same code you did.
GreyHead 18 Jul, 2012
Hi jjspelman,

Those are random ids auto-generated by ChronoForms when there is no Id set for the form element. It will probably do no harm to copy them but personally I'd go back and add meaningful ids to the elements before duplicating the form. I usually set both the name and id to the same value e.g. fist_name, email, address1, etc. This makes it easier to work with the form results and to add JavaScript if it is needed.

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