Skip to content

Instantly share code, notes, and snippets.

Created December 25, 2012 00:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/4371146 to your computer and use it in GitHub Desktop.
/* JS/JQUERY Written by the Coding Magician 2010 */
//$(document).ready(function() {
//alert("js is working");
//CAPTCHA
//});
//Validate the Recaptcha' Before continuing with POST ACTION
function validateCaptcha()
{
challengeField = $("input#recaptcha_challenge_field").val();
responseField = $("input#recaptcha_response_field").val();
var html = $.ajax({
type: "POST",
url: "validateform.php",
data: "form=signup&recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
async: false
}).responseText;
if(html == "success") {
//Add the Action to the Form
$("form").attr("action", "reg.php");
$("#submit").attr("value", "Submit");
//Add the Action to the Form
//Indicate a Successful Captcha
$("#captcha-status").html("<p class=\"green bold\">Success! Thanks you may now proceed.</p>");
} else {
$("#captcha-status").html("<p class=\"red bold\">The security code you entered did not match. Please try again.</p>");
Recaptcha.reload();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment