PageSourceSearch

https://altstetter.com/assets/js/contact-form-script.js

js altstetter.com collected 2026-10-07 03:52:54 UTC 2,136 bytes, 59 lines download raw bytes

1/*==============================================================*/
2// Contact Form  JS
3/*==============================================================*/
4(function ($) {
5    "use strict"; // Start of use strict
6    $("#contactForm").validator().on("submit", function (event) {
7        if (event.isDefaultPrevented()) {
8            formError();
9            submitMSG(false, "Haben Sie alle Felder ausgefuellt?");
10        } 
11        else {
12            event.preventDefault();
13            submitForm();
14        }
15    });
16
17    function submitForm(){
18        // Initiate Variables With Form Content
19        var name = $("#name").val();
20        var email = $("#email").val();
21        var msg_subject = $("#msg_subject").val();
22        var phone_number = $("#phone_number").val();
23        var message = $("#message").val(); 
24		var gridCheck = $("#gridCheck").val();
25
26        $.ajax({
27            type: "POST",
28            url: "assets/php/form-process.php",
29            data: "name=" + name + "&email=" + email + "&msg_subject=" + msg_subject + "&phone_number=" + phone_number + "&message=" + message +"&gridCheck=" + gridCheck,
30            success : function(text){
31                if (text == "success"){
32                    formSuccess();
33                } 
34                else {
35                    formError();
36                    submitMSG(false,text);
37                }
38            }
39        });
40    }
41    function formSuccess(){
42        $("#contactForm")[0].reset();
43        submitMSG(true, "Nachricht wurde gesendet!")
44    }
45    function formError(){
46        $("#contactForm").removeClass().addClass('shake animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
47            $(this).removeClass();
48        });
49    }
50    function submitMSG(valid, msg){
51        if(valid){
52            var msgClasses = "h4 tada animated text-success";
53        } 
54        else {
55            var msgClasses = "h4 text-danger";
56        }
57        $("#msgSubmit").removeClass().addClass(msgClasses).text(msg);
58    }
59}(jQuery)); // End of use strict

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.