Add overnight button
This commit is contained in:
@@ -166,9 +166,9 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row animate-box overnight">
|
<div class="row animate-box overnight" id="overnight-div">
|
||||||
<input type="checkbox" id="overnight" name="overnight" checked>
|
<input class="overnight-js" type="checkbox" name="overnight" checked>
|
||||||
<label for="overnight">Übernachtungsangebot</label>
|
<label for="overnight">Braucht Ihr einen Schlafplatz?</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="row animate-box">
|
<div class="row animate-box">
|
||||||
<div class="col-md-4 col-md-offset-4 text-center fh5co-heading">
|
<div class="col-md-4 col-md-offset-4 text-center fh5co-heading">
|
||||||
|
|||||||
22
js/main.js
22
js/main.js
@@ -306,6 +306,16 @@
|
|||||||
$(window).stellar({ horizontalScrolling: false });
|
$(window).stellar({ horizontalScrolling: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var defaultUncheckedInputCheckboxes = function() {
|
||||||
|
var inputs = document.getElementsByTagName('input');
|
||||||
|
|
||||||
|
for (var i=0; i<inputs.length; i++) {
|
||||||
|
if (inputs[i].type == 'checkbox') {
|
||||||
|
inputs[i].checked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
mobileMenuOutsideClick();
|
mobileMenuOutsideClick();
|
||||||
@@ -320,6 +330,7 @@
|
|||||||
counter();
|
counter();
|
||||||
counterWayPoint();
|
counterWayPoint();
|
||||||
addField();
|
addField();
|
||||||
|
defaultUncheckedInputCheckboxes();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -366,9 +377,15 @@ document.getElementById("js-submitbtn").addEventListener("click", async function
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let overnightRequired = false;
|
||||||
|
|
||||||
|
if ($('.overnight-js').is(":checked")) {
|
||||||
|
overnightRequired = true;
|
||||||
|
}
|
||||||
|
|
||||||
let family = {
|
let family = {
|
||||||
name: lastname,
|
name: lastname,
|
||||||
overnight: true,
|
overnight: overnightRequired,
|
||||||
telephonenumber: telephonenumber,
|
telephonenumber: telephonenumber,
|
||||||
email: eMail,
|
email: eMail,
|
||||||
members: []
|
members: []
|
||||||
@@ -418,7 +435,7 @@ document.getElementById("js-submitbtn").addEventListener("click", async function
|
|||||||
redirect: 'follow', // manual, *follow, error
|
redirect: 'follow', // manual, *follow, error
|
||||||
referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
|
referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
|
||||||
body: JSON.stringify(family) // body data type must match "Content-Type" header
|
body: JSON.stringify(family) // body data type must match "Content-Type" header
|
||||||
});
|
}).catch(function (timeout) { SubmitError("API error. Call the phone number."); });
|
||||||
if(response.ok)
|
if(response.ok)
|
||||||
{
|
{
|
||||||
let jsonResponse = await response.json();
|
let jsonResponse = await response.json();
|
||||||
@@ -477,6 +494,7 @@ document.getElementById("js-submitbtn").addEventListener("click", async function
|
|||||||
}).catch(function (timeout) { });
|
}).catch(function (timeout) { });
|
||||||
|
|
||||||
document.getElementById("attentant-container").remove();
|
document.getElementById("attentant-container").remove();
|
||||||
|
document.getElementById("overnight-div").remove();
|
||||||
document.getElementById("js-submitbtn").disabled = 'true';
|
document.getElementById("js-submitbtn").disabled = 'true';
|
||||||
document.getElementById("js-submitbtn").textContent = await translator.getTranslationByKey(document.documentElement.lang,"already_participating");
|
document.getElementById("js-submitbtn").textContent = await translator.getTranslationByKey(document.documentElement.lang,"already_participating");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user