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
  • 2816 views


Show first post

29 replies

Userlevel 6
Badge +7
Hi @gwrightiv! If you have a different question, it would be best to start a new question so that it goes into the "Unanswered" queue and gets more attention from other users. That doesn't mean you can't link back to this thread, however!
Userlevel 1
Badge
hijacking this thread, Is there a way to add a grey text into the text field that after clicking in goes away?
Userlevel 4
Badge
That worked, thank you!!
Userlevel 4
Badge +5
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'});
}


});
```

Leave a Reply