aradianoff / recaptchacontact

reCaptcha Contact Plugin for Grav CMS (getgrav.org)
MIT License
8 stars 11 forks source link

how add data-callback to my captcha #33

Closed cocodrino closed 7 years ago

cocodrino commented 7 years ago

Hello!...I need disable the submit button until the user fill the captcha, this is solved using data-callback


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

how could pass this data-callback in my form markdown?

also would be interesting in integrate this more deeply with the form plugin, right now I'll write the js code in the template, would be great a more simple solution, thank you!!

bassplayer7 commented 7 years ago

@cocodrino - I'm sorry about the delay in getting back to you on this. I didn't see the notification until just now: and a month later at that.

To add the data-callback attribute, the easiest way at this point would be to override the recaptchaform.html.twig (source) template. Then you can add the attribute. Does that answer your question? Or perhaps I didn't follow.

Thanks for the suggestion to integrate the callback into the plugin. I think it could be good to allow for easier customization in that regard.

cocodrino commented 7 years ago

yeah thank you, no problem, I ended using some javascript in my code, it's not the ideal way but for a small project did the job, hope than in a future will exist some way more simple, thank you!!!...

bassplayer7 commented 7 years ago

@cocodrino sounds good and that makes sense.