Server IP : 62.72.28.201 / Your IP : 18.116.49.243 Web Server : LiteSpeed System : Linux in-mum-web1113.main-hosting.eu 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : u249650955 ( 249650955) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : ON Directory (0755) : /home/u249650955/domains/ladyflorencepublicschool.com/public_html/admin_area/../js/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
/* Abstract : Ajax Page Js File File : dz.ajax.js #CSS attributes: .dzForm : Form class for ajax submission. .dzFormMsg : Div Class| Show Form validation error/success message on ajax form submission #Javascript Variable .dzRes : ajax request result variable .dzFormAction : Form action variable .dzFormData : Form serialize data variable */ (function($) { "use strict"; function contactForm() { window.verifyRecaptchaCallback = function (response) { $('input[data-recaptcha]').val(response).trigger('change'); } window.expiredRecaptchaCallback = function () { $('input[data-recaptcha]').val("").trigger('change'); } 'use strict'; var msgDiv; $(".dzForm").on('submit', function(e) { e.preventDefault(); //STOP default action $('.dzFormMsg').html('<div class="gen alert alert-success">Submitting..</div>'); var dzFormAction = $(this).attr('action'); var dzFormData = $(this).serialize(); $.ajax({ method: "POST", url: dzFormAction, data: dzFormData, dataType: 'json', success: function(dzRes){ if(dzRes.status == 1){ msgDiv = '<div class="gen alert alert-success">'+dzRes.msg+'</div>'; } if(dzRes.status == 0){ msgDiv = '<div class="err alert alert-danger">'+dzRes.msg+'</div>'; } $('.dzFormMsg').html(msgDiv); $('.dzForm')[0].reset(); grecaptcha.reset(); } }) }); setInterval(function(){ $('.dzFormMsg .alert').hide(1000); }, 10000); /* This function is for mail champ subscription START*/ $(".dzSubscribe").on('submit', function(e) { e.preventDefault(); //STOP default action var dzFormAction = $(this).attr('action'); var dzFormData = $(this).serialize(); $.ajax({ method: "POST", url: dzFormAction, data: dzFormData, dataType: 'json', success: function(dzRes) { if(dzRes.status == 1){ msgDiv = '<p style="color: #34A853">'+dzRes.msg+'</p>'; } if(dzRes.status == 0){ msgDiv = '<p style="color: #EA4335">'+dzRes.msg+'</p>'; } $('.dzSubscribeMsg').html(msgDiv); $('.dzSubscribe')[0].reset(); } }) }); setInterval(function(){ $('.dzSubscribeMsg p').hide(1000); }, 5000); /* This function is for mail champ subscription END*/ } jQuery(document).ready(function() { 'use strict'; contactForm(); }); })(jQuery);