<< 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 = /^(([^< 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 = /^(([^
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" + "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" + " @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" + " @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" + "> \n" + " \n" + " \n" + "<> \n" + "