* indicates a required field.
First Name
Last Name
Work email address
Phone
Organization
Tell us more about what you’re interested in
Sign me up to receive business resources and marketing communications from Bell Business Markets. You can unsubscribe at any time.
Comments
<script> ;(function(){ "use strict"; function receiveExtParams() { var that = this; // Please parent page URL (i.e.:https://www.example.com) // that.parentDomain = 'https://businessmarkets.bell.ca'; that.ext_data = {}; window.addEventListener("DOMContentLoaded", function(event) { that.init(); }); return null; } receiveExtParams.prototype.init = function() { var that = this; window.addEventListener('message', function (event) { // Ensure the message is from a trusted source (optional) // if ( event.origin.indexOf( that.parentDomain ) !== -1 ) { // Check if the message contains ext_data if (event.data && event.data.ext_data) { console.log('received message', event.data); that.ext_data = event.data.ext_data; that.fieldMapping = event.data.fieldMapping; // Execute the logic to populate form fields inside the iframe } that.checkDependencies(); } // } }); window.parent.postMessage({ extIframeLoaded: true }, '*'); return null; // Function to populate form fields with UTM values inside the iframe receiveExtParams.prototype.run = function() { var that = this; for (var i = 0; i < document.forms.length; i++) { var form = document.forms[i]; if ( (form.elements.length > 0 && form.elements[0].id === 'connector-search')) continue; Object.keys(this.ext_data).forEach(function (key) { that.addHiddenInputField(form, key, that.ext_data[key], that.fieldMapping[key] ); }); } return; } receiveExtParams.prototype.addHiddenInputField = function(form, fieldName, value = null, cssclass = null) { if ( null != cssclass ) { var fieldContainer = form.querySelector( cssclass ); // console.log( fieldContainer ); if( null != fieldContainer) { fieldContainer.value = value; } } else { var input = document.createElement("input"); input.type = "hidden"; input.name = fieldName; input.value = value; form.appendChild(input); } return; } // Function to check dependencies before running functions. receiveExtParams.prototype.checkDependencies = function() { var that = this; // Execute the logic if (that.detectIEEdge()) { //load polyfills to support latest methods in IE and edge that.loadScript("https://polyfill.io/v3/polyfill.min.js?features=Object.keys%2C Array.prototype.forEach%2CString.prototype.startsWith%2Cdocument.querySelector" , function () { that.run(); }); } else { that.run(); } return null; } receiveExtParams.prototype.loadScript = function(url, callback) { var script = document.createElement("script"); script.type = "text/javascript"; if (script.readyState) { //IE script.onreadystatechange = function () { if (script.readyState == "loaded" || script.readyState == "complete") { script.onreadystatechange = null; callback(); } }; } else { //Others script.onload = function () { callback(); }; script.unload = function () { callback(); }; } script.src = url; document.getElementsByTagName("head")[0].appendChild(script); return; } // Function to detect browser compatibility receiveExtParams.prototype.detectIEEdge = function() { var ua = window.navigator.userAgent; var msie = ua.indexOf('MSIE '); if (msie > 0) { // IE 10 or older => return version number return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); } var trident = ua.indexOf('Trident/'); if (trident > 0) { // IE 11 => return version number var rv = ua.indexOf('rv:'); return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); } var edge = ua.indexOf('Edge/'); if (edge > 0) { // Edge => return version number return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); } // other browser return false; } var run_receiveExtParams = new receiveExtParams(); })(); </script>