diff --git a/layouts/shortcodes/camp-form.html b/layouts/shortcodes/camp-form.html index bb18673..ee16da6 100644 --- a/layouts/shortcodes/camp-form.html +++ b/layouts/shortcodes/camp-form.html @@ -12,6 +12,17 @@ const age = calculate_age(birthdate); data.append("age", age); + if (data.get("parentemail") == "") { + document.getElementById('warning-email').style.visibility = 'visible'; + document.getElementById('warning-email').style.height = ''; + document.getElementById('warning-email').style.margin = ''; + return false; + } else { + document.getElementById('warning-email').style.visibility = 'hidden'; + document.getElementById('warning-email').style.height = '0'; + document.getElementById('warning-email').style.margin = '0'; + } + var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { @@ -53,6 +64,9 @@ function process() { /* document.getElementById('mt-form').hidden = false */ + document.getElementById('warning-email').style.visibility = 'hidden'; + document.getElementById('warning-email').style.height = '0'; + document.getElementById('warning-email').style.margin = '0'; } document.addEventListener('DOMContentLoaded', process); @@ -143,10 +157,10 @@ - + + class="basis-full form-input {{ $formClasses }}" required> + +