adding quicklisp and sbcl to add parenscript possibly
These are all just testing pieces but possible changes to add
This commit is contained in:
parent
cb9f3ca324
commit
4242f0d05a
9 changed files with 1888 additions and 69 deletions
|
@ -1,17 +1,9 @@
|
|||
{{ $formClasses := "bg-neutral-500 text-neutral-50 placeholder-neutral-300 focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 focus:ring-offset-transparent m-2 p-3 rounded-lg hover:bg-neutral-500 checked:text-neutral-500" }}
|
||||
|
||||
<script src="/js/forms.js"></script>
|
||||
<!-- <script src="/js/forms.js"></script> -->
|
||||
<script>
|
||||
function submitForm(e) {
|
||||
e.preventDefault();
|
||||
const form = document.getElementById('form');
|
||||
const data = new FormData(form);
|
||||
|
||||
console.log(data.get("birthdate"));
|
||||
const birthdate = new Date(data.get("birthdate"));
|
||||
const age = calculate_age(birthdate);
|
||||
data.append("age", age);
|
||||
|
||||
function validate(data) {
|
||||
console.log("validating");
|
||||
if (data.get("tetanus-shot") === "") {
|
||||
console.warn("NO DATE FOR TETANUS SHOT");
|
||||
data.set("tetanus-shot", "1111-11-11");
|
||||
|
@ -52,20 +44,40 @@
|
|||
document.getElementById('warning-image').style.margin = '0';
|
||||
}
|
||||
|
||||
if (!document.getElementById("agreement").unchecked) {
|
||||
document.getElementById('warning').style.visibility = 'visible';
|
||||
document.getElementById('warning').style.height = '';
|
||||
document.getElementById('warning').style.margin = '';
|
||||
}
|
||||
}
|
||||
function submitForm(e) {
|
||||
e.preventDefault();
|
||||
const form = document.getElementById('form');
|
||||
const data = new FormData(form);
|
||||
|
||||
console.log(data.get("birthdate"));
|
||||
const birthdate = new Date(data.get("birthdate"));
|
||||
const age = calculate_age(birthdate);
|
||||
data.append("age", age);
|
||||
|
||||
validate(data);
|
||||
|
||||
let req = new Request();
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
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/';
|
||||
/* 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/'; */
|
||||
}
|
||||
};
|
||||
xhr.open("POST", "https://n8n.tfcconnection.org/webhook/health-form");
|
||||
xhr.open("POST", "https://n8n.tfcconnection.org/webhook-test/testy");
|
||||
xhr.send(data);
|
||||
console.log(data);
|
||||
console.log("Hallo!");
|
||||
|
@ -140,7 +152,7 @@
|
|||
</script>
|
||||
|
||||
<div id="health-form" class="form text-lg w-full">
|
||||
<form id='form' onsubmit="submitForm(event)" autocomplete="on" method="post" target="_parent" class="w-full items-center flex flex-wrap">
|
||||
<form id='form' onsubmit="submitForm(event);" autocomplete="on" method="post" target="_parent" class="w-full items-center flex flex-wrap">
|
||||
<h3 class="basis-full">2023-2024 Health Form</h3>
|
||||
<div class="basis-full flex flex-wrap my-4">
|
||||
<label for="firstname" class="basis-full">What is your first and last name?</label>
|
||||
|
@ -402,7 +414,7 @@
|
|||
<div id="warning" class="basis-full mt-10 flex px-4 py-3 rounded-lg bg-[#ef4444] dark:bg-[#ef4444]">
|
||||
<span class="text-[#fca5a5] ltr:pr-3 rtl:pl-3 content-right float-right">
|
||||
{{ partial "icon.html" (.Get 0 | default "triangle-exclamation") }}
|
||||
Make sure you have uploaded a copy of your insurance card.
|
||||
You have not agreed to the liability release. Please have a guardian read and agree to it first.
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue