jquery.ajax multiple data problem
- by Guillaume P
Hi, I've been trying to make this code work for the last 3 hours. I've tried about everytinh, but I'm still unable to get it to work.
I only managed to send 1 data.
When I use this code, I only manage to retrieve recaptcha_challenge_field. If I remove recaptcha_challenge_field, I retrieve recaptcha_response_field. However, I am unable to retrieve the two at the same time.
challengeField = $("#recaptcha_challenge_field").val();
responseField = $("#recaptcha_response_field").val();
var html = $.ajax(
{
global: false,
type: "POST",
async: false,
dataType: "html",
data: "recaptcha_response_field=" + responseField + "&recaptcha_challenge_field=" + challengeField,
url: "../ajax.recaptcha.php"
}).responseText;
if(html == "success")
{
$("#captchaStatus").html("Success. Submitting form.");
return true;
}
else
{
$("#captchaStatus").html("Your captcha is incorrect. Please try again");
Recaptcha.reload();
return false;
}