Reputation: 613
I have a project in Laravel 5.5 and trying to implement Google Invisible Captcha but it keeps giving me this error on console:
Uncaught TypeError: _captchaForm.submit is not a function
The package I'm using is this one enter link description here
The error is only on the js script, I already tried removing all js from the site for just this to show but neither way works.
I have a basic form
<form action="{{ route('post-contact') }}" method="post">
{{ csrf_field() }}
<div class="form-group">
<label>Nombre:</label>
<input type="text" class="form-control" placeholder="Nombre" name="name" />
</div>
<div class="form-group">
<label>Email:</label>
<input type="email" class="form-control" placeholder="Email" name="email" />
</div>
<div class="form-group">
<label>Mensaje:</label>
<textarea class="form-control height-120" placeholder="Mensaje" name="msg"></textarea>
</div>
@captcha('en')
<div class="form-group">
<button class="btn theme-btn" name="submit" type="submit">Enviar consulta</button>
</div>
</form>
I already enable debug on the console and it says that everything is binded as it should:
Checking element binding of _submitForm...
true
Checking element binding of _captchaForm...
true
Checking element binding of _captchaSubmit...
true
Any help will be appreciated, this is driving me nuts since yesterday.
Thanks
Upvotes: 1
Views: 604
Reputation: 613
My god I feel so stupid, the submit button had a name="submit" attribute breaking the js of the invisible captcha.
Just for anyone that might have this issue in the future, make sure you don't have an element with that name!
Upvotes: 3