Reduce your donations to Azure in 2026 - Check Now

Turbo360

Turbo360's Articles

/*$(document).ready(function() { if ($(window).width() >= 1000) { const modalKey = 't360_popup_request_shown'; const today = new Date().toISOString().slice(0, 10); let typingTimer; // Timer for real-time validation delay const doneTypingInterval = 600; // Wait 600ms after typing stops to check business email // 1. Exit Intent Trigger if (localStorage.getItem(modalKey) !== today) { $(document).on('mouseleave', function(e) { if (e.clientY < 0) { $('#t360_popup_request').modal('show'); localStorage.setItem(modalKey, today); $(document).off('mouseleave'); } }); } // 2. Real-time Input Logic: Clear errors and check business email $('#Popup_Email').on('input', function() { var emailInput = $(this); var sEmail = $.trim(emailInput.val()); var errorBox = $('#Popup_Error_Box'); var errorContent = $('#Popup_Error_Content'); // IMMEDIATELY clear "Email is required" or red borders when they start typing emailInput.removeClass("error"); errorBox.hide(); // Clear the timer for business email check clearTimeout(typingTimer); // If it looks like a valid email, check if it's a business email AFTER they pause typing if (sEmail.length > 5 && validateEmail(sEmail)) { typingTimer = setTimeout(function() { validCompanyEmail(sEmail).done(function(result) { if (result !== "true" && result !== true) { // It's a personal email (gmail/yahoo/etc) emailInput.addClass("error"); errorContent.text(result); errorBox.attr('style', 'display: block !important;'); } }); }, doneTypingInterval); } }); // 3. Prevent Enter Key Refresh $('#Popup_Email').on('keydown', function(e) { if (e.keyCode === 13) { e.preventDefault(); $('#Popup_Submit').trigger('click'); } }); // 4. Main Submission Logic $('#Popup_Submit').on('click', function(e) { e.preventDefault(); var emailInput = $('#Popup_Email'); var sEmail = $.trim(emailInput.val()); var errorBox = $('#Popup_Error_Box'); var errorText = $('#Popup_Error_Content'); var finalUrl = window.location.origin + '/signup?email=' + encodeURIComponent(sEmail); // Reset UI emailInput.removeClass("error"); errorBox.hide(); // Check if empty if (sEmail.length == 0) { emailInput.addClass("error"); errorText.text("Email is required."); errorBox.show(); return false; } // Final Validation on Click if (validateEmail(sEmail)) { validCompanyEmail(sEmail).done(function (result) { if (result === "true" || result === true) { // API Lead Capture call try { $.ajax({ type: 'POST', url: 'https://secure.biztalk360.com/api/serverless360/create-update-user', data: JSON.stringify({ "Email": sEmail, "SignupStage": 3, "SystemEnvironment": 0, "QueryString": window.location.href }), contentType: "application/json", dataType: 'json' }); } catch (err) {} // Successful redirect window.location.href = finalUrl; } else { // Business Email Error emailInput.addClass("error"); errorText.text(result); errorBox.attr('style', 'display: block !important;'); // Shake effect $('.getstarted_signup').addClass('wrong-entry'); setTimeout(function() { $('.getstarted_signup').removeClass('wrong-entry'); }, 500); } }); } else { // Invalid Format Error emailInput.addClass("error"); errorText.text("Please enter a valid email address."); errorBox.show(); } }); // Email Regex Helper function validateEmail(email) { return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); } } });*/