My goal is that a form button is enabled, if the user correctly responded to the recaptcha, I already found a solution using pure javascript (stackoverflow solution), but I need to do it with VueJs, when using the data-callback attribute of recaptcha, it indicates an error, the which says: "ReCAPTCHA could not find user-provided function: responseRC ()", with which I can not get the answer and activate the button.
My code - HTML
<div id='app'>
<label for="name">
<input type="text" name="name" v-model="namex">
</label>
<label for="agree">
<input id="agree" type="checkbox" value="agree" />I Agree</lable>
<p>
<hr>
<div class="g-recaptcha" data-sitekey="6Ld8BDUU0000Edp4MdRqV24fKJe8llSzLfiEQEH" data-callback="responseRC()" ></div>
<hr>
<button :name="buttonX" disabled>Button</button>
</div>
Code Vue JS
var ins = new Vue({
el : '#app',
data: {
//checked : false,
namex: 'Javier',
buttonX: ''
},
mounted: function() {
this.buttonX.disabled;
console.log('monta algo');
},
beforeupdated: function(){
console.log('cambia algo');
this.buttonX.disabled.false;
},
methods: {
disableButton: function(){
this.buttonX.disabled=false;
},
responseRC: function(){
console.log("The captcha has been already solved");
if(grecaptcha.getResponse().length !== 0){
console.log("The captcha has been already solved");
}
}
}
});