camp form rough draft

The camp form is basically finished. I need to have some folks look at
it to make sure we've got it all done right.
This commit is contained in:
Chris Cochrun 2023-03-22 09:40:07 -05:00
parent d3c7dc699b
commit 31bab3cf3b
4 changed files with 72 additions and 14 deletions

View file

@ -15,16 +15,29 @@
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Logic directing where to send the user after form submission based on results.
// This is how to send them. window.location.href = '/thankyou/';
let payment = data.get('registration');
console.log(payment);
let health = data.get('health');
console.log(health);
if (health === 'later') {
if (payment === 'now')
window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JPJ';
else if (payment === 'full')
window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JQE';
else
window.location.href = '/thankyou/';
}
else {
if (payment === 'later')
window.location.href = '/thankyou/';
else
window.location.href = '/camp-health-form?registration=' + payment;
}
var payment = document.getElementById('registration').value;
window.location.href = '/camp-health-form?registration=' + payment;
// Need to eventually get the user here: https://secure.myvanco.com/L-Z772/campaign/C-13DM3
}
};
/* xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-application"); */
xhr.open("POST", "https://n8n.tfcconnection.org/webhook-test/camp-form");
xhr.open("POST", "https://n8n.tfcconnection.org/webhook/camp-form");
xhr.send(data);
console.log(data);
console.log("Hallo!");
@ -112,10 +125,13 @@
<input type="radio" id="grade" name="grade" value="senior"
class="form-input {{ $formClasses }}">
<label for="grade" class="">Senior</label>
<input type="radio" id="grade" name="grade" value="college-freshman"
class="form-input {{ $formClasses }}">
<label for="grade" class="">College Freshman</label>
</div>
<label for="homephone" class="basis-full">Guardian's phone <span class='inline-block text-[#f39] text-sm align-sub'>* required</span></label>
<input type="tel" id="homephone" name="homephone"
<label for="parentphone" class="basis-full">Guardian's phone <span class='inline-block text-[#f39] text-sm align-sub'>* required</span></label>
<input type="tel" id="parentphone" name="parentphone"
class="basis-full form-input {{ $formClasses }}">
<label for="parentemail" class="basis-full">Guardian's Email</label>
@ -128,13 +144,14 @@
class="basis-full form-input {{ $formClasses }}">
<label for="week" class="basis-full">My Camp Plan <span class='inline-block text-[#f39] text-sm align-sub'>* required</span></label>
<select id="week" name="tfcgroup" class="flex-auto form-select {{ $formClasses }}">
<select id="week" name="week" class="flex-auto form-select {{ $formClasses }}">
<option value="week1">Week 1: July 17-21</option>
<option value="week2">Week 2: July 24-28</option>
</select>
<label for="shirt" class="basis-full">T-Shirt Size</label>
<select id="shirt" name="shirt" class="flex-auto form-select {{ $formClasses }}">
<option value="ylg">Youth Large</option>
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
@ -155,8 +172,25 @@
</label>
</div>
</div>
<label for="health" class="basis-full">
Would you like to fill out the health form now or later? <span class='inline-block text-[#f39] text-sm align-sub'>* required</span>
</label>
<div class="basis-full">
<input type="radio" value="now" id="health" name="health"
class="form-input {{ $formClasses }}" checked>
<label for="health" class="">
Now
</label>
</div>
<div class="basis-full">
<input type="radio" value="later" id="health" name="health"
class="form-input {{ $formClasses }}">
<label for="health" class="">
Later
</label>
</div>
<label for="registration" class="basis-full">
Would you like to pay the registration fee now or later? <span class='inline-block text-[#f39] text-sm align-sub'>* required</span>
Would you like to pay the registration fee or the full cost now or later? <span class='inline-block text-[#f39] text-sm align-sub'>* required</span>
</label>
<div class="basis-full">
<input type="radio" value="now" id="registration" name="registration"
@ -165,11 +199,18 @@
Now - $65
</label>
</div>
<div class="basis-full">
<input type="radio" value="full" id="registration" name="registration"
class="form-input {{ $formClasses }}" checked>
<label for="registration" class="">
Full Cost - $165
</label>
</div>
<div class="basis-full">
<input type="radio" value="later" id="registration" name="registration"
class="form-input {{ $formClasses }}">
<label for="registration" class="">
Later - Send $65 to the TFC Office
Later - Send $65 or $165 to the TFC Office
</label>
</div>
<div class="basis-full mt-8">

View file

@ -56,6 +56,10 @@
if (this.readyState == 4 && this.status == 200) {
if (mtRegistration === 'now')
window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13DM3';
else if (registration === 'now')
window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JPJ';
else if (registration === 'full')
window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JQE';
else
window.location.href = '/thankyou/';
}