Hi,
I have created a Marketing form hosted that into webpage as an Iframe and I want to change the language of form by using query parameter in url . For that I have added below Javascript/Jquery code to the HTML of Marketing form but JS code is not working nor I am able to debug the code as it is inside the Iframe.Below is my code:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function getParameterByName(name, url) {
debugger;
if (!url) url =window.parent.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var dynamicContent = getParameterByName('lang');
$(document).ready(function () {
debugger;
// $('#lang').val('eng');
// $('#lang').on('change', function() {
console.log('click');
if (dynamicContent == "en") {
debugger;
$(".cls_email").html("E-mail");
$(".cls_company").html("Company");
$(".cls_name").html("Name");
$(".cls_surname").html("Last Name");
$(".cls_submit").html("Submit");
}
});
Can Anyone Suggest any way to change the language of the form?
Thanks.