Skip to main content
/* Ask AU */ /* Contact Us Form */ $.ajax({ url: 'https://www.athabascau.ca/scripts/university-relations/mainsite/askau/index.php', type: 'POST', data: {data: window.location.search}, success: function (response) { /* load results via ajax call from askau/index.php */ $("#askau-wrapper").html(response); $("#content-title").css("visibility", "visible"); if ( $(".askau-answer").length ) { $("#askau-contactform").show(); $(".form-wrap").show(); } $(".last-update").css("visibility", "visible"); $.getScript("https://www.athabascau.ca/framework/v1/theme/js/mainsite/askau.js"); }, error: function (e) { console.log(e); }, }); $(document).ajaxComplete(function (event, request, settings) { $("#askau-wrapper").show(function () { setTimeout(function () { $(".ask-au-explore-questions-by-topic, #askau-contact-form").show(); }, 600); }); /* Add question to page title */ if ($('#askau-question').length) { const $question = $('#askau-question').text(); document.title = $question + " | Ask AU | Online Learning | Athabasca University"; } }); 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; } } var contactForm = $("#askau-contact-form"); contactForm.validate({ errorElement: "span", errorPlacement: function (error, element) { error.insertBefore(element.parent(".input-group, .checkbox, .radio-group")); }, errorLabelContainer: "#form-error", rules: { confirm_email: { equalTo: "#email", }, }, messages: { confirm_email: { equalTo: "Email address must match", }, }, submitHandler: function submitForm() { /* Get the values from the form */ var fname = $("#firstname").val(); var lname = $("#lastname").val(); var q = $("#askau-input").val(); var type = $("#type").val(); var title = $("#title").val(); var email = $("#email").val(); var phone = $("#phone").val(); var category = $("input[name='categories']:checked").val(); var student_id = $("#student_id").val(); var question = $("#question").val(); /* checking if recaptcha has been interacted with */ if (grecaptcha.getResponse().length > 0) { $.ajax({ type: "POST", url: "https://www.athabascau.ca/scripts/university-relations/mainsite/askau/form-submission.php", data: { firstname: fname, lastname: lname, q: q, type: type, title: title, email: email, phone: phone, categories: category, question: question, student_id: student_id, captcha: grecaptcha.getResponse(), }, success: function (response) { contactForm.fadeOut("slow", function () { var $email = $("#email").val(); $("#thank-you").fadeIn("slow"); $("#thank-you p strong").text($email); }); }, }); return false; } }, }); /* Smooth scroll to top 10 questions by topic */ $(function () { setTimeout(function () { var hash = window.location.hash; if (hash == "#questions-by-topic") { $("html, body").animate( { scrollTop: $("#questions-by-topic").offset().top - 10, }, 500 ); return false; } }, 700); });