1 2window.start_load = function () { 3 $('body').prepend('<div id="loader"></div>') 4} 5window.end_load = function () { 6 $('#loader').fadeOut('fast', function () { 7 $(this).remove(); 8 }) 9} 10 11 12// function include(file) { 13// var script = document.createElement('script'); 14// script.src = file; 15// script.type = 'text/javascript'; 16// script.defer = true; 17// document.getElementsByTagName('body').item(0).appendChild(script); 18// } 19 20// include('https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit'); 21 22 23// var onloadCallback = function() { 24// if ( $('#html_element_2').length ) { 25// grecaptcha.render('html_element_2', {'sitekey' : '6LcTfNghAAAAADz1HIj1Ykt4xlWiUv1XeWcZye3m' 26// }); 27// } 28 29// } 30 31 32 33$(document).ready(function () { 34 $('#register-form').submit(function (e) { 35 e.preventDefault() 36 37 var that = $(this); 38 var errorCount = 0; 39 $("#register-form .with-errors").remove(); 40 $("#register-form .border-danger").removeClass('border-danger'); 41 $("#register-form").find(".mandatory").each(function () { 42 var that = $(this); 43 var inputVal = that.val(); 44 var inputId = that.attr("id"); 45 inputVal = $.trim(inputVal); 46 that.removeClass("border-danger"); 47 if (inputVal == "") { 48 that.addClass("border-danger"); 49 errorCount++; 50 } else if (inputId == "contactEmail") { 51 52 if (!mailValidation(inputVal)) { 53 that.after('<div class="text-danger with-errors">Please Enter Valid Email!</div>'); 54 that.addClass("border-danger"); 55 errorCount++; 56 } 57 58 } 59 60 }); 61 62 var gCaptchaResponse = grecaptcha.getResponse(0); 63 if (gCaptchaResponse == "") { 64 $('#html_element_2').after('<div class="with-errors"><span class="text-danger with-errors">Please verify I am not robot</span></div>'); 65 errorCount++; 66 } 67 68 if (errorCount == 0) { 69 start_load(); 70 $.ajax({
71 url: 'contact-form-submit.php', 72 method: 'POST', 73 data: $(this).serialize(), 74 error: err => { 75 console.log(err) 76 end_load(); 77 }, success: function (resp) { 78 if (resp == 1) { 79 $('#register-form')[0].reset(); 80 location.href = 'thank-you.php'; 81 } else { 82 end_load(); 83 alert('something went wrong please try again'); 84 85 } 86 87 } 88 89 }) 90 91 } else { 92 return false; 93 } 94 95 }); 96 97 var sampleBtn = $('.datasets-sample-button .sample-btn'); 98 sampleBtn.attr('href', 'javascript:void(0);'); 99 sampleBtn.attr('id', 'downloadBtn'); 100 sampleBtn.attr('data-bs-toggle', 'modal'); 101 sampleBtn.attr('data-bs-target', '#new-popup-form'); 102 103}); 104 105 106 107function mailValidation(inputText) { 108 109 var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; 110 111 if (reg.test(inputText) == false) { 112 113 return false; 114 115 } 116 117 return true; 118 119} 120 121 122 123
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.