TransWikia.com

Captcha won't show up when load contact form by Static Block

Magento Asked on November 23, 2021

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.

One Answer

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>

Answered by Aamir on November 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP