function soSubmit(el) { if (!soFormValidate(el)) { //e.preventDefault(); return false; } const behaviour = el.getAttribute('data-behaviour'); soBody = document.getElementsByTagName("body")[0]; soBodyOriginalStyleHeight = soBody.style.height; soBodyOriginalStyleOverflow = soBody.style.overflow; const element = document.createElement("input"); element.setAttribute("type", "hidden"); element.setAttribute("name", "referrer"); element.setAttribute("value", window.location.href); el.appendChild(element); if (behaviour == 'new_tab') return true; if (behaviour == 'modal') return soSubmitModal(el); if (behaviour == 'be_in_touch') return soSubmitBeInTouch(el); if (behaviour == 'redirect') return soSubmitRedirect(el); } function soFormValidate(el) { const domain = el.querySelector('input[name="domain"]'); const email = el.querySelector('input[name="email"]'); const phone = el.querySelector('input[name="phone"]'); const firstName = el.querySelector('input[name="first_name"]'); const lastName = el.querySelector('input[name="last_name"]'); const custom = el.querySelector('input[name="custom_field"]'); const consent = el.querySelector('input[name="consent"]'); if (0 == domain.value.length) return alert(domain.getAttribute("data-validation")), !1; if (domain.value = domain.value.trim().replace(/\/$/, ""), !domain.value.match(/^(https?:\/\/)?[a-z\d\-]{1,62}\..*/i)) return alert(domain.getAttribute("data-validation")), !1; if (null != firstName && 0 == firstName.value.length) return alert(firstName.getAttribute("data-validation")), !1; if (null != lastName && 0 == lastName.value.length) return alert(lastName.getAttribute("data-validation")), !1; if (null != email) { if (0 == email.value.length) return alert(email.getAttribute("data-validation")), !1; //var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; const regex = /^(([^ <>()[\]\.,;:\s@\"]+(\.[^ <
>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^ <
>()[\]\.,;:\s@\"]+\.)+[^ <
>()[\]\.,;:\s@\"]{2,})$/i; if (!regex.test(email.value)) return alert(email.getAttribute("data-validation")), !1; } if (null != phone && 7 > phone.value.length) return alert(phone.getAttribute("data-validation")), !1; if (null != custom && 0 == custom.value.length) return alert(custom.getAttribute("data-validation")), !1; if (null != consent && false === consent.checked) return alert(consent.getAttribute("data-validation")), !1; setTimeout(function () { el.reset(); }, 50); return true; } function soSubmitModal(el) { const modalWrapper = document.createElement("div"); const button = el.querySelector('input[name="button"]'); let html = " <
style type=\"text/css\">\n" + " @media (max-width:500px) { #so-widget-modal-content { width:100% !important; height:100% !important; margin-top:50px !important; } }\n" + " @media (max-width:500px) and (max-height:550px) { #so-widget-modal-content { height:100% !important;} }\n" + " @media (min-height:601px) and (max-height:750px) and (min-width:501px) { #so-widget-modal-content { margin-top:100px !important; } }\n" + " @media (max-height:600px) and (min-width:501px) { #so-widget-modal-content { margin-top:80px !important; } }\n" + " #iframe-wrapper {width: 100%;height: 100%;-webkit-overflow-scrolling: touch !important}\n" + " #iframe-wrapper iframe {height: 100%;width: 100%;}\n" + " > \n" + " <
div id=\"so-widget-modal-overlay\" style=\"position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.6); display:none; opacity:0; transition:opacity 0.3s ease;\">\n" + "\t\t\t <
div id=\"so-widget-modal-content\" style=\"position:relative; width:80%; max-width: 1250px; height:80%; margin:120px auto 0; background:#fff;\">\n" + "\t\t\t\t <span onclick=\"closeSoModal();\" style=\"display:inline-block; width:16px; height:16px; position:absolute; top:15px; right:15px; cursor:pointer; background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAowAAAKMB8MeazgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAB5SURBVDiNrZPRCcAwCEQfnUiySAZuF8kSWeH6Yz8KrQZMQAicJ+epAB0YwAmYJKIADLic0/GPPCbQAnLznCd/4NWUFfkgy1VjH8CryA95ApYltAiTRCZxpuoW+gz9WXE6NPeg+ra1UDIxGlWEObe4SGxY5fIxlc75Bkt9V4JS7KWJAAAAAElFTkSuQmCC59ef34356faa7edebc7ed5432ddb673d'); opacity:0.6;\"> >\n" + "\t\t\t\t >\n" + " <
div id=\"iframe-wrapper\">\n" + "\t\t\t\t <
iframe name=\"so-iframe\" id=\"so-iframe\" scrolling=\"yes\" style=\"border:1px solid transparent; width:100%; height:100%; box-sizing:border-box;\"> >\n" + "\t\t\t >\n" + "\t\t\t

2026 © Tous droits réservés – SEOMontreal.io |  📩 [email protected]

Analysez gratuitement votre site web

Un aperçu clair de la performance SEO de votre site, généré instantanément et sans obligation.