bestell- und kontak- js vereinheitlicht
This commit is contained in:
parent
1729f02bfb
commit
5a49e7a191
2 changed files with 10 additions and 8 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
window.onload = function () {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
console.log('bestellformular.js loaded');
|
||||||
|
// Rest of the code goes here
|
||||||
const FORMDEBUG = false;
|
const FORMDEBUG = false;
|
||||||
const btn = document.getElementById('bestellformular-btn');
|
const btn = document.getElementById('bestellformular-btn');
|
||||||
|
const bestellformular = document.getElementById('bestellformular');
|
||||||
// initieiere Zeitmessung zur Botprevention
|
// initieiere Zeitmessung zur Botprevention
|
||||||
var startTime = Date.now();
|
var startTime = Date.now();
|
||||||
|
|
||||||
|
|
@ -26,7 +27,7 @@ window.onload = function () {
|
||||||
document.addEventListener("touchstart", setUserInteracted);
|
document.addEventListener("touchstart", setUserInteracted);
|
||||||
document.addEventListener("keydown", setUserInteracted);
|
document.addEventListener("keydown", setUserInteracted);
|
||||||
|
|
||||||
document.getElementById('formular').addEventListener('submit', function (e) {
|
bestellformular.addEventListener('submit', function (e) {
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
|
@ -117,4 +118,4 @@ window.onload = function () {
|
||||||
// setTimeout(() => notification.className = 'bg-red-500 text-white px-4 py-2 rounded hidden', 5000); // Benachrichtigung nach 5 Sekunden ausblenden
|
// setTimeout(() => notification.className = 'bg-red-500 text-white px-4 py-2 rounded hidden', 5000); // Benachrichtigung nach 5 Sekunden ausblenden
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
})
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
|
|
||||||
const FORMDEBUG = false;
|
const FORMDEBUG = false;
|
||||||
const btn = document.getElementById('bestellformular-btn');
|
const btn = document.getElementById('kontaktformular-btn');
|
||||||
|
const kontaktformular = document.getElementById('kontaktformular');
|
||||||
// initieiere Zeitmessung zur Botprevention
|
// initieiere Zeitmessung zur Botprevention
|
||||||
var startTime = Date.now();
|
var startTime = Date.now();
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@ window.onload = function () {
|
||||||
document.addEventListener("touchstart", setUserInteracted);
|
document.addEventListener("touchstart", setUserInteracted);
|
||||||
document.addEventListener("keydown", setUserInteracted);
|
document.addEventListener("keydown", setUserInteracted);
|
||||||
|
|
||||||
document.getElementById('formular').addEventListener('submit', function (e) {
|
kontaktformular.addEventListener('submit', function (e) {
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
|
@ -110,4 +110,5 @@ window.onload = function () {
|
||||||
// setTimeout(() => notification.className = 'bg-red-500 text-white px-4 py-2 rounded hidden', 5000); // Benachrichtigung nach 5 Sekunden ausblenden
|
// setTimeout(() => notification.className = 'bg-red-500 text-white px-4 py-2 rounded hidden', 5000); // Benachrichtigung nach 5 Sekunden ausblenden
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue