How do you enter fixed text after each text box in form type? | XM Community
Skip to main content
Solved

How do you enter fixed text after each text box in form type?

  • January 31, 2020
  • 4 replies
  • 286 views

! How do you add static text after each text box in the form text type? Also, how do you add inequality signs for "greater than or equal to" or "smaller than or equal to" in the same static text?

Best answer by rondev

Use the below code jQuery("<span>>=<span>").insertAfter("#"+this.questionId+" .InputText:eq(0)"); jQuery("<span><=<span>").insertAfter("#"+this.questionId+" .InputText:eq(1)");

4 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • Answer
  • January 31, 2020
Use the below code jQuery("<span>>=<span>").insertAfter("#"+this.questionId+" .InputText:eq(0)"); jQuery("<span><=<span>").insertAfter("#"+this.questionId+" .InputText:eq(1)");

  • Author
  • January 31, 2020
Thank you again. Where am I supposed to add the fixed text in the code?

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • January 31, 2020
> @SLEE said: > Thank you again. Where am I supposed to add the fixed text in the code? Between the span tag `<span>HERE</span>`

  • May 2, 2021

I want to add the '%' sign after a free text box.
Last week I managed to add units after free text boxes using this script.
The same java script doesn't appear to be working when I tried to do it for a new question today. Can anyone assist?
Qualtrics.SurveyEngine.addOnload(function()
{
var inputs = $(this.getQuestionContainer()).select('input[type="text"]');
 
for (var i = 0; i < inputs.length; i++) {
 var input = inputs[i];
 $(input).insert({after: ' %'});
}

});

Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/

});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

});