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

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

  • 31 January 2020
  • 4 replies
  • 186 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?
icon

Best answer by rondev 31 January 2020, 02:50

View original

4 replies

Userlevel 7
Badge +22
Use the below code

jQuery("<span>>=<span>").insertAfter("#"+this.questionId+" .InputText:eq(0)");
jQuery("<span><=<span>").insertAfter("#"+this.questionId+" .InputText:eq(1)");
Thank you again. Where am I supposed to add the fixed text in the code?
Userlevel 7
Badge +22
> @SLEE said:
> Thank you again. Where am I supposed to add the fixed text in the code?

Between the span tag `<span>HERE</span>`

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*/

});

Leave a Reply