Skip to main content
/*Web feedback form*/ /*Display captcha warning message */ function checkRecaptcha() { var $reCaptcha = grecaptcha.getResponse(); if ($reCaptcha.length > 0) { document.getElementById("g-recaptcha-error").innerHTML = ""; return true; } else { document.getElementById("g-recaptcha-error").innerHTML = '

Please verify that you are not a robot.

'; return false; } } $("#request_course_materials").validate({ errorElement: "span", errorPlacement: function (error, element) { error.insertBefore(element.parent('.input-group, .checkbox, .radio-group')); }, errorLabelContainer: "#form-error", submitHandler: function submitForm() { var $reCaptcha = grecaptcha.getResponse(); if ($reCaptcha.length > 0) { var $capResponse = grecaptcha.getResponse(); $.ajax({ type: 'POST', url: 'https://prd-library-01.athabascau.ca/library/action/requestmaterial.php', dataType: 'html', data: $("#request_course_materials").serialize() + "&captcha=" + $capResponse, success: function (response) { $("form").fadeOut("slow", function () { $("#thank-you").fadeIn("fast"); }); }, error: function (exception) { console.log(exception); } }); } checkRecaptcha(); return false; }, });