function generateCreditRequestEmail() {
var x = document.getElementById("ShowEmailLink"); if (x.style.display === "block") { x.style.display = "none"; } else { x.style.display = "block"; }
var to = document.getElementById('to'); var toCompany = document.getElementById('toCompany'); var toEmail = document.getElementById('toEmail'); var date = document.getElementById('date'); var creditCompany = document.getElementById('creditCompany'); var creditCity = document.getElementById('creditCity'); var creditProvince = document.getElementById('creditProvince'); var creditPostalCode = document.getElementById('creditPostalCode'); var creditTelNo = document.getElementById('creditTelNo');
// var str = 'https://form.jotform.com/211027149793053?to='+to.value+'&toCompany='+toCompany.value+'&toEmail='+toEmail.value+'&date='+date.value+'&creditCompany='+creditCompany.value+'&creditCity='+creditCity.value+'&creditProvince='+creditProvince.value+'&creditPostalCode='+creditPostalCode.value+'&creditTelNo='+creditTelNo.value;
var strA = 'https://form.jotform.com/211027149793053?to=' var strB = to.value; var EncodedstrB = encodeURIComponent(strB); var TwoEncodedstrB = encodeURIComponent(EncodedstrB); var strC = '&'; var EncodedstrC = encodeURIComponent(strC); var strD = 'toCompany='; var strE = toCompany.value; var EncodedstrE = encodeURIComponent(strE); var TwoEncodedstrE = encodeURIComponent(EncodedstrE); var strF = '&'; var EncodedstrF = encodeURIComponent(strF); var strG = 'toEmail='; var strH = toEmail.value; var strI = '&'; var EncodedstrI = encodeURIComponent(strI); var strJ = 'date='; var strK = date.value; var EncodedstrK = encodeURIComponent(strK); var TwoEncodedstrK = encodeURIComponent(EncodedstrK); var strL = '&'; var EncodedstrL = encodeURIComponent(strL); var strM = 'creditCompany='; var strN = creditCompany.value; var EncodedstrN= encodeURIComponent(strN); var TwoEncodedstrN = encodeURIComponent(EncodedstrN); var strO = '&'; var EncodedstrO = encodeURIComponent(strO); var strP = 'creditCity='; var strQ = creditCity.value; var EncodedstrQ = encodeURIComponent(strQ); var TwoEncodedstrQ = encodeURIComponent(EncodedstrQ); var strR = '&'; var EncodedstrR = encodeURIComponent(strR); var strS = 'creditProvince='; var strT = creditProvince.value; var EncodedstrT = encodeURIComponent(strT); var TwoEncodedstrT = encodeURIComponent(EncodedstrT); var strU = '&'; var EncodedstrU = encodeURIComponent(strU); var strV = 'creditPostalCode='; var strW = creditPostalCode.value; var EncodedstrW = encodeURIComponent(strW); var TwoEncodedstrW = encodeURIComponent(EncodedstrW); var strX = '&'; var EncodedstrX = encodeURIComponent(strX); var strY = 'creditTelNo='; var strZ = creditTelNo.value; var EncodedstrZ = encodeURIComponent(strZ); var TwoEncodedstrZ = encodeURIComponent(EncodedstrZ);
var strFinal = strA+TwoEncodedstrB+EncodedstrC+strD+TwoEncodedstrE+EncodedstrF+strG+strH+EncodedstrI+strJ+TwoEncodedstrK+EncodedstrL+strM+TwoEncodedstrN+EncodedstrO+strP+TwoEncodedstrQ+EncodedstrR+strS+TwoEncodedstrT+EncodedstrU+strV+TwoEncodedstrW+EncodedstrX+strY+TwoEncodedstrZ;
//concatenate to string to build URL var url = "mailto:"+strH+"?subject=Request For Credit Information From Border Paving&body="+strFinal; //var encodedURI = encodeURI(url); //var twoencodedURI = encodeURI(encodedURI);
//document.getElementById("SendEmail").innerHTML = url;
document.getElementById("CreateEmail").href = url; document.getElementById("GeneratedSuccess").innerHTML = "Generated.";
} ;