When implementing this module into my project I've found that it doesn't work when my form extends RecaptchaForm. I have a lot of functionality in my form so I typically extend the form and contain the functionality in there instead of the controller, like so:
class CustomForm extends Form
{
....
}
However when applying the same to this module, like this:
class CustomForm extends RecaptchaForm
{
....
}
I get a javascript error Cannot read property 'addEventListener' of null. This is due to the fact the event listener is bound to getElementById('RecaptchaForm_'+'ContactForm') which is hard coded to assume the form class will be RecaptchaForm . However as I've extended this class it would need to account for the new class name - in this case CustomForm_.
Can you extend this module to account for the class name?
When implementing this module into my project I've found that it doesn't work when my form extends RecaptchaForm. I have a lot of functionality in my form so I typically extend the form and contain the functionality in there instead of the controller, like so:
However when applying the same to this module, like this:
I get a javascript error
Cannot read property 'addEventListener' of null
. This is due to the fact the event listener is bound togetElementById('RecaptchaForm_'+'ContactForm')
which is hard coded to assume the form class will beRecaptchaForm
. However as I've extended this class it would need to account for the new class name - in this caseCustomForm_
.Can you extend this module to account for the class name?