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 // handle the invalid form... 9 formError(); 10 submitMSG(false, "Did you fill in the form properly?"); 11 } else { 12 // everything looks good! 13 event.preventDefault(); 14 submitForm(); 15 } 16 }); 17 18 19 function submitForm(){ 20 // Initiate Variables With Form Content 21 var name = $("#name").val(); 22 var email = $("#email").val(); 23 var msg_subject = $("#msg_subject").val(); 24 var phone_number = $("#phone_number").val(); 25 var message = $("#message").val(); 26 var message = $("#company_name").val(); 27 var message = $("#website").val(); 28 29 30 $.ajax({ 31 type: "POST", 32 url: "assets/php/form-process.php", 33 data: "name=" + name + "&email=" + email + "&phone_number=" + phone_number + "&msg_subject=" + msg_subject + "&message=" + message + "&company_name=" + company_name + "&website=" + website, 34 success : function(text){ 35 if (text == "success"){ 36 formSuccess(); 37 } else { 38 formError(); 39 submitMSG(false,text); 40 } 41 } 42 }); 43 } 44 45 function formSuccess(){ 46 $("#contactForm")[0].reset(); 47 submitMSG(true, "Message Submitted!") 48 } 49 50 function formError(){ 51 $("#contactForm").removeClass().addClass('shake animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){ 52 $(this).removeClass(); 53 }); 54 } 55 56 function submitMSG(valid, msg){ 57 if(valid){ 58 var msgClasses = "h4 text-left tada animated text-success"; 59 } else { 60 var msgClasses = "h4 text-left text-danger"; 61 } 62 $("#msgSubmit").removeClass().addClass(msgClasses).text(msg); 63 } 64}(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.