I have set up google reCaptcha on contact us page but i dont know how to check its mandatory on submit for any other way.


To do so, you need some custom code, please follow below steps which work for me:

Note: I assume you used jQuery library on your frontend theme

Step-1: On document ready add some custom class to your reCAPTCHA input field:

<script type="text/javascript">

Step-2: Initialize Magento VarienForm javascript class object and add new validation rule for reCAPTCHA field:

<script type="text/javascript">
var yourFormValidationObj = new VarienForm('your_form_id');

Validation.add('required-captcha-entry', ' ', function(v) {
    return !Validation.get('IsEmpty').test(v);

Step-3: On form submit, validate form for required values

<script type="text/javascript">
    // Form validate and ready to submit

That's, your reCAPTCHA field is become required field and validated before submit the form.


You can try this method: Magento Enable Captcha For Contact Us Form

Hope it will help you.

  • Sorry I am using Google captcha . – Ajay Patel Mar 25 '16 at 11:48
  • Are you using reCaptcha Extension? – Umar Ali Mar 25 '16 at 11:51
  • Not extension i am customize and used this. – Ajay Patel Mar 25 '16 at 11:53
  • you can use this extension reCAPTCHA and its free – Umar Ali Mar 25 '16 at 11:55
  • i have try this but not working form e. not display captcha box. i have already set the both key. – Ajay Patel Mar 25 '16 at 11:56

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.