I have a requirement to dynamically update Pardot form labels and placeholder text to the native language of the visitor. Pardot form is hosted on an external webpage where is a dropdown to change the preferred language. Based on the selected language, the webpage content gets updated automatically.
Is there a way in Pardot that the form texts and labels could also be updated to the desired language dynamically?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
var url_string = window.location;
var url = new URL(url_string);
var language = url.searchParams.get("language");
var body = $("body").html();
if(language == "fr"){
body = body.replace("My name is Antoine","Je m'appelle Antoine");
body = body.replace("Hello","Bonjour");
}
else if(language == "es"){
body = body.replace("test","testo");
}
$("body").html(body);
});
</script>