Add input processing

This commit is contained in:
Julian
2022-02-05 17:22:39 +01:00
parent 169c2ee9b9
commit ce826a833b
2 changed files with 23 additions and 4 deletions

View File

@@ -67,7 +67,6 @@
<!--[if lt IE 9]>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
@@ -160,7 +159,7 @@
</div>
<div class="row animate-box">
<div class="col-md-4 col-md-offset-4 text-center fh5co-heading">
<button type="submit" class="btn btn-default btn-block">Absenden</button>
<button type="submit" id="js-submitbtn" class="btn btn-default btn-block">Absenden</button>
</div>
</div>
<div class="row animate-box" style="margin-top: 50px;">
@@ -196,7 +195,6 @@
<script src="js/owl.carousel.min.js"></script>
<!-- countTo -->
<script src="js/jquery.countTo.js"></script>
<!-- Stellar -->
<script src="js/jquery.stellar.min.js"></script>
<!-- Magnific Popup -->

View File

@@ -303,3 +303,24 @@
}());
//var form = document.getElementById("js-submitbtn");
document.getElementById("js-submitbtn").addEventListener("click", function () {
//form.submit();
//console.log("Hello world!");
//document.getElementById("js-attentants").elements["foo"]
var inputs = document.querySelectorAll('input');
console.log(inputs);
console.log("Vorname:" + inputs[0].value);
console.log("Nachname:" + inputs[1].value);
console.log("Telefon:" + inputs[2].value);
for (let i = 3; i < inputs.length; i+=2) {
console.log("Mitbringsel:" + inputs[i].value, inputs[i+1].value);
}
});