Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

magento add captcha to custom contact form

magento add captcha to custom contact form  using -'magento,customization,captcha,contact-form'

I created a new custom contact form in Magento website, I am trying to add captcha at the end of it.

I have added to app/code/core/Mage/Captcha/etc/config.xml

                    <label>Custom Contact Form</label>

And I added to app/design/frontend/base/default/layout/captcha.xml

    <reference name="customcontacts">
        <block type="core/text_list" name="">
            <block type="captcha/captcha" name="captcha">
                <reference name="head">
                    <action method="addJs"><file>mage/captcha.js</file></action>
                <action method="setFormId"><formId>customcontacts</formId></action>
                <action method="setImgWidth"><width>230</width></action>
                <action method="setImgHeight"><width>50</width></action>

And I added to my form this code:

<script type="text/javascript">

And I added this code to show the Captcha:

<div><?php echo $this->getChildHtml('captcha'); ?></div>

Then I enabled Captcha in Configuration > Customer Configuration > CAPTCHA and I choose "Custom Contact Form" then "Displaying Mode" to "Always".

But I still didn't get the Captcha at my custom form yet.

I hope I was clear


asked Oct 7, 2015 by atulpariharmca
0 votes

Related Hot Questions

Government Jobs Opening

Further down in the same template/contacts/form.phtml file, add in the new field to the form itself:

  • Note the validate-people text is the same in attribute as well as in the javascript function we added above.

    End result: enter image description here

    answered Oct 7, 2015 by tushar2k6