Some notes and file clean up. JJSV Templates
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
<div class="np-box-content-container">
|
||||
<form class="np-form np-box-content" name="secondaryRegistrationForm" onsubmit(return false)>
|
||||
<div class="np-form-title"> Tell us more </div>
|
||||
<div class="form-description">Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.</div>
|
||||
<div class="form-description">Please provide the additional information below to tailor your experience on the Vision Excellence Institute. We will only use the information to share Professional Education Events happening in your area and to highlight content from the site related to your role and specialty under the My Topics section.</div>
|
||||
|
||||
<div class="form-disclaimer">All fields are required</div>
|
||||
<div class="np-form-field">
|
||||
@ -155,7 +155,6 @@ console.log("{{current_person.email}}")
|
||||
let userData = {
|
||||
learner_uuid: '{{current_person.id}}',
|
||||
company: '',
|
||||
country: '',
|
||||
city: '',
|
||||
state: '',
|
||||
country: '',
|
||||
@ -181,25 +180,47 @@ console.log("{{current_person.email}}")
|
||||
specialtyField == "" ? "" : userData.specialty = specialtyField
|
||||
|
||||
if (userData.company && userData.city && userData.state && userData.country && userData.role && userData.specialty) {
|
||||
submitValidatedData(userData)
|
||||
|
||||
console.log("user Data: ", userData)
|
||||
|
||||
submitValidatedDataToLocalStorage(userData)
|
||||
submitValidatedDataToWorkato(userData)
|
||||
} else {
|
||||
$('.err-msg').show()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function submitValidatedData(data) {
|
||||
console.log(data)
|
||||
function submitValidatedDataToLocalStorage(data) {
|
||||
console.log("submitting user data to local storage")
|
||||
|
||||
// Save entered data as individual variables in local storage for later use
|
||||
localStorage.setItem("learnerCompany", data.company);
|
||||
localStorage.setItem("learnerCity", data.city);
|
||||
localStorage.setItem("learnerState", data.state);
|
||||
localStorage.setItem("learnerCountry", data.country);
|
||||
localStorage.setItem("learnerRole", data.role);
|
||||
localStorage.setItem("learnerSpecialty", data.specialty);
|
||||
|
||||
// Set isValidated value in local storage to true
|
||||
localStorage.setItem("learnerCompletedSecondaryRegistration", "true");
|
||||
}
|
||||
|
||||
function submitValidatedDataToWorkato(data) {
|
||||
console.log("submitting user data to Workato")
|
||||
|
||||
const secondaryInfoStored = localStorage.getItem("learnerCompletedSecondaryRegistration")
|
||||
|
||||
$('#completeRegistrationBtn').prop("disabled",true);
|
||||
$('#completeRegistrationBtn').addClass('submitting')
|
||||
$('.loader').show()
|
||||
$('#completeRegistrationBtn span').text('Completing Registration')
|
||||
|
||||
$.ajax({
|
||||
url: "https://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/additional-learner-info",
|
||||
data: JSON.stringify(data),
|
||||
method: 'POST',
|
||||
success: function(res){
|
||||
console.log(res)
|
||||
$('#completeRegistrationBtn').prop("disabled",true);
|
||||
$('#completeRegistrationBtn').addClass('submitting')
|
||||
$('.loader').show()
|
||||
$('#completeRegistrationBtn span').text('Completing Registration')
|
||||
|
||||
setTimeout(function() {
|
||||
window.location.replace("/app")
|
||||
@ -207,6 +228,14 @@ function submitValidatedData(data) {
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error("Error posting to workato!");
|
||||
|
||||
if (secondaryInfoStored == "true") {
|
||||
console.log("secondary information completed and stored in local storage")
|
||||
|
||||
setTimeout(function() {
|
||||
window.location.replace("/app")
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -214,6 +243,14 @@ function submitValidatedData(data) {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
height:auto;
|
||||
}
|
||||
|
||||
.np-box {
|
||||
margin:64px 0;
|
||||
}
|
||||
|
||||
.form-disclaimer {
|
||||
font-size:12px;
|
||||
margin-bottom:12px;
|
||||
|
||||
Reference in New Issue
Block a user