1
I am registering a form with Ajax, how to implement the use of reCaptcha?
<input type="text" name="email" id="email" class="form-control" placeholder="Email" required>
<div class="g-recaptcha" data-sitekey="bla,bla,bla"></div>
<input type="button" onclick="add_comment()" value="Enviar comentário" class="btn btn-primary pull-right"></button>
The Function 'add_comment()':
function add_comment() {
var url = 'comentarios/add_comment.php';
var method = 'POST';
params += '&email='+document.getElementById('email').value;
var container_id = 'comment-box' ;
var loading_text = '<img src="loader.gif">' ;
ajax (url, method, params, container_id, loading_text) ;
}
Setting an id in reCaptcha returns the value 'Undefined' The function works perfectly with registration, as I can send the value of reCaptcha to the function and validate it in the file . php?
Vlw