0

I am getting captcha at contact us page. But when same file is called in static block, contact us form works fine but captcha does not occur.

Kindly suggest any solution.

9
  • Where have you added the captcha block and how?, what is the type of your captcha
    – PЯINCƎ
    Jun 3, 2017 at 8:40
  • I have used this extension
    – user00247
    Jun 3, 2017 at 8:46
  • And called phtml file in static block as {{block type="core/template" template="mcrecaptcha/contacts/form.phtml"}}
    – user00247
    Jun 3, 2017 at 8:47
  • I haven't the code of this extension, can you share please the layout.xml of this extension ?
    – PЯINCƎ
    Jun 3, 2017 at 8:55
  • Its working in my rwd theme but in my custom theme its not working
    – user00247
    Jun 3, 2017 at 9:55

1 Answer 1

0

I think that you have the js issue,

in app/design/frontend/{package}/{theme}/template/contacts/form.phtml

replace

<script type="text/javascript">
//<![CDATA[
    var contactForm = new VarienForm('contactForm', true);
//]]>
</script>

With:

<script type="text/javascript">
//<![CDATA[
    var contactForm = new VarienForm('contactForm', true);
    function validateCaptcha() {
        var v = grecaptcha.getResponse();
          if(v.length == 0) {
               jQuery('#error-g-captcha').show();
               return false;
          }else {
              jQuery('#error-g-captcha').hide();
              return true;
          }
    }
//]]>
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.