Add contanct form script
This commit is contained in:
parent
0958fb404d
commit
fdcad5ff5e
20
assets/js/contact.js
Normal file
20
assets/js/contact.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
$("#contactForm").on("submit", function(event) {
|
||||||
|
event.preventDefault(); // Verhindert das Standard-Formular-Submit
|
||||||
|
|
||||||
|
// AJAX-Anfrage senden
|
||||||
|
$.ajax({
|
||||||
|
url: 'contactform.php',
|
||||||
|
type: 'POST',
|
||||||
|
data: $(this).serialize(), // Alle Formulardaten serialisieren
|
||||||
|
success: function(response) {
|
||||||
|
// Rückmeldung anzeigen
|
||||||
|
$("#responseMessage").html(response);
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
// Fehlernachricht anzeigen
|
||||||
|
$("#responseMessage").html("Es gab einen Fehler beim Senden der Nachricht.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -6,6 +6,7 @@
|
|||||||
{{ $util := resources.Get "js/util.js" }}
|
{{ $util := resources.Get "js/util.js" }}
|
||||||
{{ $main := resources.Get "js/main.js" }}
|
{{ $main := resources.Get "js/main.js" }}
|
||||||
{{ $demo := resources.Get "js/demo.js" }}
|
{{ $demo := resources.Get "js/demo.js" }}
|
||||||
{{ $js := slice $jQuery $scrollex $scrolly $browser $breakpoints $util $main $demo | resources.Concat "js/bundle.js" | minify | fingerprint }}
|
{{ $contact := resources.Get "js/contact.js" }}
|
||||||
|
{{ $js := slice $jQuery $scrollex $scrolly $browser $breakpoints $util $main $demo $contact | resources.Concat "js/bundle.js" | minify | fingerprint }}
|
||||||
|
|
||||||
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" async crossorigin="anonymous"></script>
|
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" async crossorigin="anonymous"></script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user