|
|
Your submission is complete
' ).fadeIn('slow'); } } }); $('#client-data-form').validate({ rules: { name: 'required', email: { required: true, email: true }, }, messages: { } }); function generateMathProblem() { var num1 = Math.floor(Math.random() * 9) + 1; // Random number between 1 and 9 var num2 = Math.floor(Math.random() * 9) + 1; // Random number between 1 and 9 var sum = num1 + num2; // Calculate the correct answer // Display the math problem in the form $('#mathProblem').text(`${num1} + ${num2} = ?`); // Get the correctAnswer field and set its value var correctAnswerField = $('#correctAnswer'); if (correctAnswerField.length) { // Check if the element exists correctAnswerField.val(sum); } else { console.error('Correct answer field is missing.'); } } // Call the function to generate the math problem on page load console.log("Generating Math Problem 1"); generateMathProblem(); // Define custom validation method $.validator.addMethod("checkMath", function (value, element) { var correctAnswer = $('#correctAnswer').val(); return this.optional(element) || value == correctAnswer; // Compare with the correct answer }, "Please enter the correct sum."); $.validator.setDefaults({ submitHandler: function (e) { var _f = $('#contact-form'); _f.attr("action", "form_proc.cfm"); if (_f.find(".antispam input").val() != "") { // honeypot was populated. don't submit console.log("honey pot filled. Potential Spam.") return false; } else { var url = "form_proc.cfm"; var formData = $("#contact-form").find(':input').not('#math, #correctAnswer, #spam-filter').serialize(); $.post(url, formData).done(function (data) { $('p.congrats').addClass('active'); }); var downloadtitle = "Thank you for signing up for our Newsletter"; var downloadtext = ""; // Clear fileds once form is submitted _f.parents('.form-container').addClass('download-ready'); _f.closest('form').find("input[type=text]").val(""); $('.form-container').empty().html(' '); } } }) $("#contact-form").validate({ highlight: function (element) { $(element).siblings('.error').attr({ 'aria-hidden': 'false', 'role': 'alert', 'aria-atomic': 'true' }); }, unhighlight: function (element) { $(element).siblings('.error').attr({ 'aria-hidden': 'true', 'role': 'alert', 'aria-atomic': 'false' }); }, rules: { fname: "required", email: { required: true, email: true }, math: { required: true, checkMath: true }, }, messages: { name: "Error Name is required", email: "Error Email address is incorrect", math: { required: "This field is required.", checkMath: "Please enter the correct sum." } } }); function cookieModal() { $('body').addClass('cookie-modal-mode'); $('.cookie-modal').filter(function () { var lastFocus; if ($.cookie("dismiss") == null || typeof ($.cookie("dismiss")) == "undefined") { setTimeout(function () { $('.index .cookie-modal .modal').fadeIn(1000, "linear", function () { $('body').addClass('modal-open'); var selectItem = $(this); $(this).attr({ 'aria-hidden': 'false' }) // Get last Focus and Set New focus lastFocus = document.activeElement; setTimeout(function () { $(selectItem).find('input#cookie-form-fname').focus(); }, 500); }); }, 2000); }; // Contact Validator $.validator.setDefaults({ submitHandler: function (e) { var _f = $('#contact-form'); if (_f.find(".antispam input").val() != "not spam") { // honeypot was populated. don't submit return false; } else { var url = "form_proc.cfm"; var formData = $("#contact-form").serializeArray(); $.post(url, formData).done(function (data) { $('p.congrats').addClass('active'); }); var downloadtitle = "Thank you for signing up for our Newsletter"; var downloadtext = ""; // Clear fileds once form is submitted _f.parents('.modal-container').addClass('download-ready'); _f.closest('form').find("input[type=text], textarea").val(""); $('.form-container').empty().html(' '); // Activate COOKIE to prevent form from showing again var date = new Date(); var minutes = 2; // Expires in 2min for demo purposes date.setTime(date.getTime() + (minutes * 60 * 1000)); $.cookie("dismiss", true, { expires: date // Replace "date" this with "30" for 30-day expiry }); } } }); $("#contact-form").validate({ highlight: function (element) { $(element).siblings('.error').attr({ 'aria-hidden': 'false', 'role': 'alert', 'aria-atomic': 'true' }); }, unhighlight: function (element) { $(element).siblings('.error').attr({ 'aria-hidden': 'true', 'role': 'alert', 'aria-atomic': 'false' }); }, rules: { fname: "required", email: { required: true, email: true } }, messages: { name: "Error Name is required", email: "Error Email address is incorrect" } }); $('#cookie-modal-close, .cookie-modal .overlay, .cookie-modal .btn.close-this').click(function () { $('.cookie-modal>.modal').attr('aria-hidden', 'true'); $('.cookie-modal>.modal').fadeOut(1000, "linear"); $('body').removeClass('modal-open'); // Return to last Focus lastFocus.focus(); }); }); // Trap Focus for this modal trapFocus('#pop'); return false; } function trapFocus(modalName) { // How to Use this function: // On modal open - Get last Focus and Set New focus // On modal close - Return to last Focus // Call the function trapFocus(modalName); $(modalName).filter(function () { // Close all Modal on Esc lastFocus = document.activeElement; $('.close-this, .modal>.overlay').click(function () { $('body').removeClass('modal-open'); $(modalName).attr({ 'aria-hidden': 'true' }); $(modalName).fadeOut(1000, "linear"); // Return to last Focus lastFocus.focus(); }); $(this).on('keydown', function (e) { var keyCode = e.keyCode || e.which; if (keyCode == 27) { e.preventDefault(); $(modalName).find('button.close-this').trigger("click"); } }); $(".last-focus-item").on('keydown', function (e) { var keyCode = e.keyCode || e.which; if (keyCode == 9 && !(event.shiftKey && event.keyCode == 9)) { // call custom function here if ($('.first-focus-item:visible').length != 0) { e.preventDefault(); $('.first-focus-item').focus(); } } }); $(".first-focus-item").on('keydown', function (e) { var keyCode = e.keyCode || e.which; if (event.shiftKey && event.keyCode == 9) { // call custom function here if ($('.last-focus-item:visible').length != 0) { e.preventDefault(); $('.last-focus-item').focus(); } } }); }); return false; } const containerVideo = document.querySelectorAll('.hero_video_fullwidth'); containerVideo.forEach(function (section) { let videoContainer = section, video = section.querySelector('video'), videoControls = section.querySelector('.hero-button'), mute = section.querySelector('button[data-state="unmute"]'); // Changes the button state of certain button's so the correct visuals can be displayed with CSS var changeButtonState = function (type) { // Mute button if (type == 'mute') { mute.setAttribute('data-state', video.muted ? 'unmute' : 'mute'); } } mute.addEventListener('click', function (e) { video.muted = !video.muted; changeButtonState('mute'); }); }) window.addEventListener('load', scrollCheck); window.addEventListener('resize', function () { if (this.innerWidth > document.body.clientWidth) { scrollCheck(); } else { document.scrollingElement.style .setProperty( '--scrollbar-width', '0px' ); } }); function scrollCheck() { let scroller = document.scrollingElement; scroller.style .setProperty( '--scrollbar-width', window.innerWidth - scroller.clientWidth + 'px' ); // Reset overflow scroller.style .setProperty( 'overflow', '' ); }; fetchContactSection() function fetchContactSection() { let contactSection = '(Home Office)
8611 Highway 23, Suite 1-C
Belle Chasse, LA 70037
Also, offering meeting accommodations in Metairie and Covington!