0

After enabling captcha for the contact form the captcha is not shown on the form. If submitted an "Incorrect CAPTCHA" error is displayed. Select stores->Configuration->Customers->Customer Configuration->Captch->Forms->Contact us and save

Form.phtml file

escapeUrl($block->getFormAction()) ?>" id="contact-form" method="post" data-hasrequired="escapeHtmlAttr(__('* Required Fields')) ?>" data-mage-init='{"validation":{}}'> escapeHtml(__('Write Us')) ?>
escapeHtml(__('Jot us a note and we’ll get back to you as quickly as possible.')) ?> escapeHtml(__('Name')) ?> escapeHtmlAttr(__('Name')) ?>" value="escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('name') ?: $this->helper('Magento\Contact\Helper\Data')->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/> escapeHtml(__('Email')) ?> escapeHtmlAttr(__('Email')) ?>" value="escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('email') ?: $this->helper('Magento\Contact\Helper\Data')->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/> escapeHtml(__('Phone Number')) ?> escapeHtmlAttr(__('Phone Number')) ?>" value="escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('telephone')) ?>" class="input-text" type="text" /> escapeHtml(__('What’s on your mind?')) ?> escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}">escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('comment')) ?> getChildHtml('form.additional.info') ?> escapeHtmlAttr(__('Submit')) ?>" class="action submit primary"> escapeHtml(__('Submit')) ?>
0

Check contact us form template file form.phtml has <?= $block->getChildHtml('form.additional.info') ?> code inside on it.

I think your template(phtml does not have this code)

4
  • Can you send me the code please? – gill Nov 17 '20 at 4:42
  • which code?<?= $block->getChildHtml('form.additional.info') ?> please checkout contact_index_index.xml at vendor/magento/module-contact You can understand – Amit Bera Nov 17 '20 at 17:08
  • contact_index_index file: <referenceContainer name="content"> <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"> <container name="form.additional.info" label="Form Additional Info"/> </block> </referenceContainer> – gill Nov 18 '20 at 23:46
  • form.phtml file: <?= $block->getChildHtml('form.additional.info') ?> – gill Nov 18 '20 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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