Forums

custom form code: core captcha

jj135 15 Oct, 2011
H1, i just started using V4. I usally creat my own form code. Now I need to add a captcha. I tried {imageverification} and also {chronocaptcha_img}. But both do not work. The code is shown in the frontend, not the captcha field/image. I added the load captcha action to the form.

I also tried a form using the from wizard. (no custom formcode). I added the captcha input field tot the form and this works OK. So it is possible to show te capcha image.

So now i'n not sure how to get this captcha working when I want to use an custom form. (I put:
<?php include_once('formulieren/contact_formulier.php');?>
in the HTML code textarea and create my form in Dreamweaver and upload the form to the server.)

Can anyone point me in the right direction?
GreyHead 15 Oct, 2011
Hi jj135,

I just buit a form with {chronocaptcha_img} in the Form Code tab and Load Captcha and Show HTML actions in the On Load event. That seems to work fine.

Bob
jj135 17 Oct, 2011
Hi Bob,

Thanks for your reply. I just tried the code in the Form Code tab as well. And it works. But the difference is I include my form code using the php include code. (The form code is in the included PHP file) and then the image code does not show up. It just shows the code itself. Even when there is only the captcha image code in the included file.

Any ideas?

Thanks!
GreyHead 17 Oct, 2011
Hi jj135,

Ah OK. You have a couple of choices.

a) You can put your include statement into a Custom element - leaving out the Submit button and Captcha and then add those using the standard elements. Or

b) You can copy and paste the code created by the Captcha element and put that into your included HTML. I think it is
<img src="<?php echo JURI::base(); ?>components/com_chronoforms/chrono_verification.php?imtype=1" alt="" />


Bob
jj135 17 Oct, 2011
Hi Bob,

Thanks for this! The code (b) worked. Except for a minor change:

<img src="<?php echo JURI::base(); ?>components/com_chronoforms/chrono_verification.php?imtype=1" alt="" />


(No ' before components/...)

From what I've seen so far version 4 is a real improvement! :mrgreen:

Thanks for the support.
GreyHead 17 Oct, 2011
Hi jj135,

Apologies for my typo, I fixed my original post.

Bob
pollito 23 Oct, 2011
i could call the captcha image with {chronocaptcha_img} in the form manager. but i dont find a text field for the user to enter the captcha. how can i call the input field?
GreyHead 24 Oct, 2011
Hi pollito,

Please see this video for the default Captcha installation:

Bob

[flash=640,360]http://www.youtube.com/v/XvFJ7RqN9LA[/flash]
pollito 24 Oct, 2011
you only show how to add the "captcha input" field in the wizard. but if i am using the form manager, the input field is missing. is there no {curlybrackets} way to call it?
jj135 25 Oct, 2011
You just need to add a form field in your form HTML, for example:

<input maxlength="5" size="5" class="chrono_captcha_input" title="" label_over="0" hide_label="0" type="text" value="" name="chrono_verification" /><img src="<?php echo JURI::base(); ?>components/com_chronoforms/chrono_verification.php?imtype=1" alt="" />
pollito 25 Oct, 2011
thanks jj!
that's what i was looking for.
This topic is locked and no more replies can be posted.