Dynamically adding a dollar sign before or after a Constant Sum depending on the language | XM Community
Skip to main content

Does anyone know how to add dollar sign depending on language? For English, the dollar sign needs to be before the text box but for French it has to be after.

Hi,
You can add the symbol based on country parameter or language parameter.
Qualtrics.SurveyEngine.addOnReady(function()
{
var country = "${e://Field/country}"
//English
if(country == 1)
{
jQuery('input[type="text"]').before('$')
}
//FR - if code is 2
if(country == 2)
{
jQuery('input[type="text"]').after('$')
}
});
OR
Qualtrics.SurveyEngine.addOnReady(function()
{
var lang = "${e://Field/Q_lang}"
//English
if(lang == 'EN')
{
jQuery('input[type="text"]').before('$')
}
//FR - if code is 2
if(lang == 'FR')
{
jQuery('input[type="text"]').after('$')
}
});


Leave a Reply