[jQuery] Validate + Captcha + Remote
Hi,
I use captcha to prevent spam in this way (token is a random string
needed to validate user input field)
var token = 'somerandomstring';
$(".myform").validate({
rules: {
captcha: {
required: true,
remote: "/captcha.php?t="+token
}
}
});
Now i need to refresh che captcha code, so I call this function:
function newCaptcha()
{
$.getJSON("/newCaptcha.php", function(data){
token = data.t;
// some stuff
});
}
Why the validator doesn't use the new token?