Forums

NoCaptcha in external file

mattiadj 16 May, 2017
Hello to all,
I'm using a complex form and I need to use external file which contains all form's code.
I have added a require in custom code and all is OK but to load the NoCaptcha system I have to write this piece of code out from my file and after the require in custom code box.

It's possible to include the NoCaptcha string into external file and load it on front?

I hope my question is clear.

All the best
GreyHead 16 May, 2017
Hi mattiadj,

Yes, you can copy and paste the HTML from another form and be sure to add the Load NoCaptcha action in the Setup tab.

Bob
mattiadj 16 May, 2017
Hi GreyHead, probably my question is not clear. I have an external file but if i add the {ReCaptcha} string into this external file, ReCaptcha does not show

I attach an image so i can be more detailed. I want to use only


<?php 
$path = JPATH_SITE;
require $path.'/form/contatti/index.php';?>


And add into index.php file all the code.

I hope now i'm a bit more clear.

Screen at: https://drive.google.com/open?id=0B9d59XB61pEOVmlINU1Wc1FZUkE
GreyHead 16 May, 2017
Hi mattiadj,

I think that you need to copy the HTML that is generated from {ReCaptcha} to get it to work that way.

Bob
mattiadj 16 May, 2017
Where can i find this html generated?

Thanks
GreyHead 16 May, 2017
Hi mattiadj,

". . . you can copy and paste the HTML from another form . . ." there's a demo form if you don't have one already.

Bob
mattiadj 16 May, 2017
sorry i haven't understand....
GreyHead 18 May, 2017
Hi mattiadj,

The {ReCaptcha} should work if the Load ReCaptcha action is in your form.

I think that this is the HTML that is generated by it - though with your sitekey included:
<div class="form-group gcore-form-row" id="form-row-recaptcha">
  <label for="recaptcha" class="control-label gcore-label-left">Enter Code</label>
  <div class="gcore-input gcore-display-table" id="fin-recaptcha">
    <div class="g-recaptcha" data-sitekey=". . . .">
    </div>
  </div>
</div>

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