I am registering a form with Ajax, how do I 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 register, how can I send the value of reCaptcha to the function and validate it in the .php file?
Vlw