function getIP(json) { document.getElementById("ip").value = json.ip } var fieldsMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY = []; var strform = '{"class":[],"styles":[],"css":[{"name":".iti{width: 100%;margin-top: -25px;margin-bottom: 15px;}.container-vN55bQGB57{margin: 0 auto;width: 100%;padding: 0 15px;}.container-vN55bQGB57 .title-vN55bQGB57{font-size: 30px;line-height: 36px;font-weight: 700;margin: 15px 0;text-align: center;font-family: Segoe UI;}.container-vN55bQGB57 .form-vN55bQGB57{background-color:#fff;padding: 5px 10px;border-radius: 30px;font-family: Segoe UI;}.container-vN55bQGB57 .col-12-vN55bQGB57{position: relative;width: 100%;min-height: 1px;margin-bottom:15px;}.container-vN55bQGB57 .label-vN55bQGB57{display: inline-block;margin-bottom: .5rem;}.container-vN55bQGB57 .btn-vN55bQGB57{display:block;margin:0 auto;background-color:#1f648b;color:#fff;border-radius:0;border:0;padding:10px 35px;outline:none;}.container-vN55bQGB57 .textarea-vN55bQGB57{resize:none;border:1px solid #aaa;border-radius:15px;outline:none;color:darkgray;background-color:#fff;}.container-vN55bQGB57 .input-vN55bQGB57{height:40px;width:100%;padding:0 20px;border: 1px solid #aaa;border-radius:50px;color:darkgray!important;outline:none;}.container-vN55bQGB57 .g-recaptcha{display:flex;justify-content:center;}"}],"old_css":[{"name":".iti{width: 100%;margin-top: -25px;margin-bottom: 15px;}.container-vN55bQGB57{margin: 0 auto;width: 100%;padding: 0 15px;}.container-vN55bQGB57 .title-vN55bQGB57{font-size: 30px;line-height: 36px;font-weight: 700;margin: 15px 0;text-align: center;font-family: Segoe UI;}.container-vN55bQGB57 .form-vN55bQGB57{background-color:#fff;padding: 5px 10px;border-radius: 30px;font-family: Segoe UI;}.container-vN55bQGB57 .col-12-vN55bQGB57{position: relative;width: 100%;min-height: 1px;margin-bottom:15px;}.container-vN55bQGB57 .label-vN55bQGB57{display: inline-block;margin-bottom: .5rem;}.container-vN55bQGB57 .btn-vN55bQGB57{display:block;margin:0 auto;background-color:#1f648b;color:#fff;border-radius:0;border:0;padding:10px 35px;outline:none;}.container-vN55bQGB57 .textarea-vN55bQGB57{resize:none;border:1px solid #aaa;border-radius:15px;outline:none;color:darkgray;background-color:#fff;}.container-vN55bQGB57 .input-vN55bQGB57{height:40px;width:100%;padding:0 20px;border: 1px solid #aaa;border-radius:50px;color:darkgray!important;outline:none;}.container-vN55bQGB57 .g-recaptcha{display:flex;justify-content:center;}"}]}' var attributesForm = JSON.parse(strform) var meta = document.createElement('meta'); meta.name = "csrf-token"; meta.content = "G817RAE02tl3et9H8bIBK5YgJuenib3tuDjxou7U"; document.getElementsByTagName('head')[0].appendChild(meta); var element = document.getElementById("uxyX9nubzL0xd81") element.setAttribute("class", "container-vN55bQGB57 row col-md-12 justify-content-center") element.setAttribute("id", "MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY") var div = document.createElement("div") div.setAttribute("class", "col-md-12 text-center") var scriptNational = document.createElement("script") scriptNational.setAttribute("src","https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/intlTelInput.min.js") scriptNational.defer = true scriptNational.async = true var styleNational = document.createElement("link") styleNational.setAttribute("rel","stylesheet") styleNational.setAttribute("href","https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/css/intlTelInput.css") var title = document.createElement("H2") title.setAttribute("class","title-vN55bQGB57 ") var elem = document.createTextNode("GET IN TOUCH") title.appendChild(elem) div.appendChild(title) element.appendChild(div) element.appendChild(scriptNational) element.appendChild(styleNational) //element.appendChild(customCss) var style = document.createElement('STYLE') var css = "" attributesForm.css.forEach(function (value) { css = css + value.name + " " }) style.innerHTML = css; div.appendChild(style) var form = document.createElement("FORM") var classes = "form-vN55bQGB57" attributesForm.class.forEach( function (value) { classes = classes + value.name + " " }) form.setAttribute("class", classes) var styless = "" attributesForm.styles.forEach( function (value) { styless = styless + value.name + " " }) form.setAttribute("style",styless) form.setAttribute("id","form-MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY") form.setAttribute("method","get") form.setAttribute("action","https://forms.woobsing.co/registerForm") form.setAttribute("autocomplete", "off") form.setAttribute("autocapitalize", "off") form.setAttribute("name", "form-MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY") var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "id") x.setAttribute("value", "G20M46czYbPS6DQ") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "client_name") x.setAttribute("value", "Colegio Gran BretaƱa - CGB") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "_token") x.setAttribute("value", "G817RAE02tl3et9H8bIBK5YgJuenib3tuDjxou7U") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "latitude") x.setAttribute("id", "latitude") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "longitude") x.setAttribute("id", "longitude") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "ip") x.setAttribute("id", "ip") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "host") x.setAttribute("id", "host") x.setAttribute("value", window.location.href) form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "notifications") x.setAttribute("id", "notifications") x.setAttribute("value", "false") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "navigator") x.setAttribute("id", "navigator") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "isp") x.setAttribute("id", "isp") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "country") x.setAttribute("id", "country") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "countryCode") x.setAttribute("id", "countryCode") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "timezone") x.setAttribute("id", "timezone") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "zip") x.setAttribute("id", "zip") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "cookie") x.setAttribute("id", "cookie") x.setAttribute("value", "") form.appendChild(x) var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"first_name","nameControl":"first_name","label":"Name","class":[{"name":"form-control"}],"styles":[],"options":"","required":false,"placeholder":"Name"}' var attributes = JSON.parse(str) var t = document.createTextNode(attributes.label) if(t!=''){ var label = document.createElement("LABEL") label.setAttribute("class","label-vN55bQGB57"); label.appendChild(t) div.appendChild(label) form.appendChild(div) } var x = document.createElement("INPUT"); x.setAttribute("type", "text") x.setAttribute("name", attributes.nameControl) x.setAttribute("required", "required") x.setAttribute("id", attributes.nameControl) if(attributes.placeholder){ x.setAttribute("placeholder", attributes.placeholder) } x.setAttribute("value", "") var classes = "input-vN55bQGB57 " attributes.class.forEach( function (value) { classes = classes + value.name + " " }) x.setAttribute("class", classes) var styless = "" attributes.styles.forEach( function (value) { styless = styless + value.name + " " }) x.setAttribute("style", styless) div.appendChild(x) form.appendChild(div) element.appendChild(form) fieldsMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"email","nameControl":"email","label":"Email","class":[{"name":"form-control"}],"styles":[],"options":"","required":false,"placeholder":"Email"}' var attributes = JSON.parse(str) var t = document.createTextNode(attributes.label) if(t!=''){ var label = document.createElement("LABEL") label.setAttribute("class","label-vN55bQGB57"); label.appendChild(t) div.appendChild(label) form.appendChild(div) } var x = document.createElement("INPUT"); x.setAttribute("type", "email") x.setAttribute("name", attributes.nameControl) x.setAttribute("required", "required") x.setAttribute("id", attributes.nameControl) if(attributes.placeholder){ x.setAttribute("placeholder", attributes.placeholder) } x.setAttribute("value", "") var classes = "input-vN55bQGB57 " attributes.class.forEach( function (value) { classes = classes + value.name + " " }) x.setAttribute("class", classes) var styless = "" attributes.styles.forEach( function (value) { styless = styless + value.name + " " }) x.setAttribute("style", styless) div.appendChild(x) form.appendChild(div) element.appendChild(form) fieldsMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"cell_phone","nameControl":"cell_phone","label":"Phone number","class":[{"name":"form-control"}],"styles":[{"name":null},{"name":"color:#000000;"},{"name":"background-color:#FFFFFF;"},{"name":"font-size:100;"}],"options":"","required":false,"placeholder":"Phone number"}' var attributes = JSON.parse(str) var t = document.createTextNode(attributes.label) if(t!=''){ var label = document.createElement("LABEL") label.setAttribute("class","label-vN55bQGB57"); label.appendChild(t) div.appendChild(label) form.appendChild(div) } var x = document.createElement("INPUT"); x.setAttribute("type", "tel") x.setAttribute("name", attributes.nameControl) x.setAttribute("required", "required") x.setAttribute("id", attributes.nameControl) if(attributes.placeholder){ x.setAttribute("placeholder", attributes.placeholder) } x.setAttribute("value", "") var classes = "input-vN55bQGB57 " attributes.class.forEach( function (value) { classes = classes + value.name + " " }) x.setAttribute("class", classes) var styless = "" attributes.styles.forEach( function (value) { styless = styless + value.name + " " }) x.setAttribute("style", styless) div.appendChild(x) form.appendChild(div) element.appendChild(form) fieldsMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY.push(attributes.nameControl); var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://forms.woobsing.co/js/nationalv2.js") x.defer = true x.async = true form.appendChild(x) element.appendChild(form) var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"additional-details","nameControl":"additional-details","label":"Additional details","class":[],"styles":[{"name":null},{"name":"color:#000000;"},{"name":"background-color:#FFFFFF;"},{"name":"font-size:100;"}],"options":"","required":false,"placeholder":""}' var attributes = JSON.parse(str) var t = document.createTextNode(attributes.label) if(t!=''){ var label = document.createElement("LABEL") label.setAttribute("class","label-vN55bQGB57") label.appendChild(t) div.appendChild(label) form.appendChild(div) } var x = document.createElement("TEXTAREA") x.setAttribute("type", "textarea") x.setAttribute("name", attributes.nameControl) x.setAttribute("required", "required") x.setAttribute("id", attributes.nameControl) x.setAttribute("col", "5") x.setAttribute("rows", "6") x.setAttribute("value", "") var classes = "textarea-vN55bQGB57" attributes.class.forEach( function (value) { classes = classes + value.name + " " }) x.setAttribute("class", classes) var styless = "" attributes.styles.forEach( function (value) { styless = styless + value.name + " " }) x.setAttribute("style", styless) div.appendChild(x) form.appendChild(div) element.appendChild(form) fieldsMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"areyouinterestedin","nameControl":"Are you interested in?","label":"Are you interested in?","class":[],"styles":[{"name":null},{"name":"color:#000000;"},{"name":"background-color:#FFFFFF;"},{"name":"font-size:100;"}],"options":[{"id":"Visiting the School Campus","value":"Visiting the School Campus"},{"id":"Attending an online informative meeting","value":"Attending an online informative meeting"},{"id":"Beginning the admissions process","value":"Beginning the admissions process"}],"required":false,"placeholder":""}' var attributes = JSON.parse(str) var childDiv = document.createElement("div") childDiv.setAttribute("class", "col-12-vN55bQGB57") var label = document.createElement("LABEL") label.setAttribute("class","label-vN55bQGB57") var t = document.createTextNode(attributes.label) label.appendChild(t) childDiv.appendChild(label) div.appendChild(childDiv) form.appendChild(div) var i=0 var controlName = "checkbox" attributes.options.forEach( function (value) { var childDiv = document.createElement("div") childDiv.setAttribute("class", "col-md-6") var x = document.createElement("INPUT") x.setAttribute("type", "checkbox") if(controlName == 'checkbox') { x.setAttribute("name", attributes.nameControl+i) i++ } else x.setAttribute("name", attributes.nameControl) x.setAttribute("value", value.value) var classes = "" attributes.class.forEach( function (value) { if(value.name == null) classes = "" else classes = classes + value.name + " " }) x.setAttribute("class", classes) childDiv.appendChild(x) var label = document.createElement("LABEL") var t = document.createTextNode(value.id) label.appendChild(t) childDiv.appendChild(label) div.appendChild(childDiv) form.appendChild(div) element.appendChild(form) }) var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"send","nameControl":"Send","label":"https:\/\/forms.woobsing.co\/registerForm","class":[{"name":"btn btn-primary"}],"styles":[],"options":"","required":false,"placeholder":""}' var attributes = JSON.parse(str) var x = document.createElement("BUTTON") var classes = "btn-vN55bQGB57 btnsubmit-MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY " attributes.class.forEach( function (value) { classes = classes + value.name + " " }) x.setAttribute("class", classes) var styless = "" attributes.styles.forEach( function (value) { styless = styless + value.name + " " }) x.setAttribute("style", styless) x.setAttribute("onClick", "") var elem = document.createTextNode(attributes.nameControl); x.appendChild(elem) div.appendChild(x) form.appendChild(div) element.appendChild(form) var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://forms.woobsing.co/js/script.js") div.appendChild(x) var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://api.ipify.org?format=jsonp&callback=getIP") div.appendChild(x) let SdonxjAizwERnIr = false; var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://www.google.com/recaptcha/api.js") x.defer = true x.async = true div.appendChild(x) var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js") div.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "client_id") x.setAttribute("value", "562") form.appendChild(x) document.getElementById('form-MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY').addEventListener('submit', function(e) { let setphone; if (typeof phoneInput !== 'undefined' && typeof phoneInput !== null && typeof phoneInput !== undefined) { setphone = phoneInput.getNumber(intlTelInputUtils.numberFormat.E164); } else { setphone = false; } var ValidationreCaptcha; e.preventDefault(); e.stopPropagation(); let btn = document.querySelector('.btnsubmit-MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY'); btn.setAttribute("disabled", ""); btn.innerHTML += '...'; if(setphone){ document.querySelector("input[type='tel']").value = setphone}; validateDataMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY(); if(SdonxjAizwERnIr){ try { ValidationreCaptcha = grecaptcha.getResponse(); } catch (err) { ValidationreCaptcha = ""; } formSubmitMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY(); } }) function formSubmitMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY() { let scriptUrl = 'https://script.google.com/macros/s/AKfycbyRIHC4Yg3Cad8ASBMk3PzchW4VvMfcn90TT5EN2NvUMunVDo9UerY_e0THRVJIOPIfeQ/exec'; let datatoform = document.forms['form-MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY']; fetch(scriptUrl, { method: 'POST', body: new FormData(datatoform) }) .then((res) => { console.log(res); }) .catch((error) => { console.error('Error', error.message) }); setTimeout(() => { var form = document.getElementById('form-MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY'); form.submit(); }, "150"); } function validateDataMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY() { fieldsMzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY.forEach(ele => { var input = document.getElementById(ele); if (input.value == "" || input.value == null) { SdonxjAizwERnIr = false; var element = document.getElementById(ele+'_p'); if(element !== null) element.parentNode.removeChild(element); var p = document.createElement("p"); p.innerHTML = 'Por favor llena este campo'; p.setAttribute('style', 'color: red'); p.setAttribute('id', ele+'_p'); var div = input.parentNode; div.appendChild(p); } else { SdonxjAizwERnIr = true; var element = document.getElementById(ele+'_p'); if(element !== null) element.parentNode.removeChild(element); } }); } window.onload = getMetaData(); function getMetaData() { getCookieParams(); var navi = document.getElementById('navigator') navi.value = navigator.userAgent; setTimeout(function () { var ip = document.getElementById('ip').value; axios.get('https://forms.woobsing.co/getInfo?ip='+ip) .then((response) => { var isp = document.getElementById('isp'); var country = document.getElementById('country'); var countryCode = document.getElementById('countryCode'); var timezone = document.getElementById('timezone'); var zip = document.getElementById('zip') isp.value = response.data.isp; country.value = response.data.country; countryCode.value = response.data.countryCode; timezone.value = response.data.timezone; zip.value = response.data.zip; }) .catch((error) => { console.log(error) }) }, 2000); } function getCookieParams() { const cookies = document.cookie.split('; '); var found = false; var cookie = null; cookies.forEach((value) => { const parts = value.split('='); if (parts[0] == 'remember_data_form' && found == false) { cookie = parts[1]; found = true; } }); if (found == false) { cookie = uuid(); setCookie('remember_data_form', cookie, 1024); } document.getElementById('cookie').value = cookie; autocompleteFormData(cookie); } function setCookie(name, value, days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/"; } function uuid(){ var dt = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = (dt + Math.random()*16)%16 | 0; dt = Math.floor(dt/16); return (c=='x' ? r :(r&0x3|0x8)).toString(16); }); return uuid; } function autocompleteFormData(cookie) { var form = new FormData(); form.append('cookie', cookie); var req = new XMLHttpRequest(); req.open("POST", "https://forms.woobsing.co/user/data/params"); req.addEventListener('load', function (evt) { try { if (req.status == 200) { const data = JSON.parse(req.response); loadUserParams(data); } } catch (e) { return; } }, false) req.send(form); } function loadUserParams(user) { for (var i = 0; i < document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children.length; i++) { if (document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children[i].getAttribute("id") == "form") { for (var j = 0; j < document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children[i].children.length; j++) { for (var k = 0; k < document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children[i].children[j].getElementsByTagName("input").length; k++) { var input = document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children[i].children[j].getElementsByTagName("input")[k].getAttribute("name"); input = input.toLowerCase(); switch (input) { case 'name': case 'names': case 'nombre': case 'nombres': case 'first_name': document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children[i].children[j].getElementsByTagName("input")[k].value = user.name; break; case 'last_name': case 'lastName': case 'surname': case 'surnames': case 'apellido': case 'apellidos': document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children[i].children[j].getElementsByTagName("input")[k].value = user.surname; break; case 'email': case 'e-mail': case 'correo': case 'correos': document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children[i].children[j].getElementsByTagName("input")[k].value = user.email; break; case 'phone': case 'cellphone': case 'cellphones': case 'telefono': case 'telefonos': case 'phone_number': document.getElementById("MzVhZDcwODEOGYyMMzNzYzNGYNDMzZDkZmVmNjY").children[i].children[j].getElementsByTagName("input")[k].value = user.phone; break; } } } } } }