0

I am working with Google Re-Captcha and would like to enable the submit button once the Re-Captcha have been filled. I want to add a callback function to the Div class my code looks something like this:

<div class="input-field col s12">
    {{ form.captcha.errors }}
       <div data-callback="enableBtn"></div>
    {{ form.captcha }}
 </div>

This currently returns the data-callback outside of the form.captcha. How can I add the data-callback attribute to the form.captcha?

So for ex: If form.captcha is

<div class="g-recaptcha" data-sitekey="== xxxxxx =="></div> 

Instead of having

<div class="g-recaptcha" data-sitekey="== xxxxxx ==" data-callback="enableBtn">

I have

<div data-callback="enableBtn">
<div class="g-recaptcha" data-sitekey="== xxxxxx =="></div> 
5
  • What do you mean by outside of the function ? Is that enableBtn function called ? Commented Dec 28, 2016 at 7:29
  • @RajaSimon My mistake, I meant outside of the form.captcha! I'll update to explain further Commented Dec 28, 2016 at 7:32
  • @RajaSimon I want to enable the submit button after the Re-Captcha have been completed. So once it is completed the enableBtn function get's called Commented Dec 28, 2016 at 7:37
  • Are you using this github.com/praekelt/django-recaptcha ? Commented Dec 28, 2016 at 7:37
  • I'm using github.com/ImaginaryLandscape/django-nocaptcha-recaptcha Commented Dec 28, 2016 at 7:39

1 Answer 1

1

You can specify widget url...

NORECAPTCHA_WIDGET_TEMPLATE (string) = location for the widget template.

Please refer this html and make it like one and placed in your template and point it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.