How to add static text after a text entry box? | XM Community
Solved

How to add static text after a text entry box?

  • 11 November 2017
  • 29 replies
  • 2672 views


Show first post

29 replies

Userlevel 2
Badge +3
Hi @TomG
This is how I do the pipe text.
!
The result that I got is ${q://QID490/ChoiceTextEntryValue}
Am I doing it wrong?

___I don't understand your "Should I pipe to the new translated question(English) or to the original question (Indonesia)?" question. You can't choose which language to pipe. Qualtrics pipes the current language.___
What I mean for that question is, when I want to choose questions to pipe, should I choose my original question or should I choose new question that I just created (English).

Also, as I said, when I do think, my original question did not contain static year anymore.
Thank you.
Userlevel 7
Badge +27
@Sheryl,

Yes, unfortunately, you are doing it wrong. I think you've misunderstood what I've been trying to explain from the beginning. I'll start from the beginning one last time:

1. Create a multiple choice question at the BEGINNING of your survey. Label it "PT" for "Piped Translations". Respondents will not see this question. It's only purpose it to contain words or phrases that need to be piped into various parts of the survey in the current language.
* * Add to the PT question, in your base language, words or phrases that you will need to pipe as choices
* * After adding the choices to the PT question, translate the choices using the Qualtrics translate functionality
* * Hide the PT question using display logic. Use a display logic condition that is always false.

2. Pipe the PT question choice descriptions into other questions in the survey as needed. Make sure you use the correct pipe string. One way to do this is to go to a question's text and click on "Piped text...", then choose the PT question and the appropriate choice description. This string can then be copied wherever you need it (e.g. into a JavaScript).
Userlevel 7
Badge +37
I am using this approach and it works perfectly when (a) I only have one text prompt or (b) all the prompts on a grid should have the same label. I am wondering if there is a tweak I need to use so that I could use two different labels (where one label should be "days" and another should be "%" for example)?



> @Clint said:
> With the addition of some JavaScript on the question, you can get this done.
>
> This example shows how to put text on either side of the text entry box.
> https://gist.github.com/13bzhang/92be517b6558132c78620ad029c77f4d
>
> ```
> Qualtrics.SurveyEngine.addOnload(function()
> {
> /*Place Your Javascript Below This Line*/
>
> var inputs = $(this.getQuestionContainer()).select('input[type="text"]');
>
> for (var i = 0; i < inputs.length; i++) {
> var input = inputs[i];
> $(input).insert({before: 'In '});
> $(input).insert({after: ' years'});
> }
>
>
> });
> ```
Badge +2

The github link no longer works

Leave a Reply