From 81ec2b78d55d2eeafb68b523b47c003ff8c2f021 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Sat, 1 Feb 2014 12:59:08 -0800 Subject: Adding classes form to assessment results page. --- web/scripts/growth.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'web/scripts') diff --git a/web/scripts/growth.js b/web/scripts/growth.js index fa5e3a9..8e56afd 100644 --- a/web/scripts/growth.js +++ b/web/scripts/growth.js @@ -247,3 +247,38 @@ function chapterComplete() notice("You've completed this chapter!"); location.href += "/completed"; } + +function submitClassForm() +{ + notice("Submitting Class Form..."); + + var firstname = $("#firstname").val(); + var lastname = $("#lastname").val(); + var phone = $("#phone").val(); + var email = $("#email").val(); + + if (firstname == "") { + alert("First name is required."); + return false; + } else if (lastname == "") { + alert("Last name is required."); + return false; + } else if (phone == "") { + alert("Phone is required."); + return false; + } else if (email == "") { + alert("Email is required."); + return false; + } + + $.ajax({ + type: "POST", + url: "http://www.myfoursquarechurch.com/grow-classes/#response", + data: $("#classform").serialize(), + dataType: html, + }).always(function() { + location.href="/account/training/introduction"; + }); + + return false; +} -- cgit v1.2.3